Path: utzoo!attcan!uunet!snorkelwacker!think!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Super Macho Hackers! (was Re: Novice Questions) Message-ID: <7013@jpl-devvax.JPL.NASA.GOV> Date: 8 Feb 90 00:05:34 GMT References: <1004@frankland-river.aaii.oz.au> <14678@fluke.COM> <1990Feb6.223117.16428@iwarp.intel.com> <20620@watdragon.waterloo.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 49 In article <20620@watdragon.waterloo.edu> ccplumb@lion.waterloo.edu (Colin Plumb) writes: : In article <1990Feb6.223117.16428@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: : >In article <14678@fluke.COM>, inc@tc (Gary Benson) writes: : >| One person wrote that PERL was "created by Super Macho Hackers to keep their : >| Maniac Power Urges under control". I don't know about that, but I am certain : >| that this person's next statement is right on the mark: PERL is *not* a : >| trivial language. : > : > Larry? A "Super Macho Hacker"? : > : > I've never heard *that* applied to him before. :-) : : I confess; 'twas me who said it. I just felt that anyone who : puts socket calls in a script language is revealing a subconsious : desire to write a newer and more feature-laden sendmail in said : language, just to prove It Can Be Done. Actually, I was thinking about what I'd need to write the new rn in perl. I don't want to rewrite sendmail. (Not consciously, anyway. :-) : I wonder if anyone's set the sticky bit on their Perl yet. No point on my system--there's always a perl script of some sort executing... : BTW, given a truly arbitrary filename in $file (e.g. : '>>/new : line/back\slash/Caller*ID/huh?/a pipe looks like this: |'), : what's the best way to open it in various modes? A fairly general way would be: $file =~ s#^(\s)#./$1#; # protect leading whitespace open(FOO, "< $file") || die "Can't open $file: $!\n"; Substitute any other mode for < as necessary. The only thing this won't work on is files with trailing whitespace. I'd have to change one line in doio.c, and then you could say open(FOO, "< $file\0") || die "Can't open $file: $!\n"; since Unix will ignore the trailing null. Unfortunately, I have a strlen in the open routine where I should just use the current length of the string, so it would chop the null too early. I'll change it in patch 9. I'm presuming you are expecting the slashes to be interpreted as subdirectory delimiters in your arbitrary filename. Perl can't ordinarily create files with slashes in the filename. The other hash-n-trash is no problem. Larry