Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: PERL mucks with "magic number?" Message-ID: <8045@jpl-devvax.JPL.NASA.GOV> Date: 9 May 90 23:20:38 GMT References: <1990May8.220641.20501@uvaarpa.Virginia.EDU> <15471@bfmny0.UU.NET> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 17 In article rm55+@andrew.cmu.edu (Rudolph T. Maceyko) writes: : Here's one for you. Say I have a PERL script which begins with : #!/short/path/to/perl ;-> ... Does PERL get invoked TWICE in order to : execute the script? Once from the kernel, and once again by PERL? : And, if so, how does PERL know when to stop, since it'll see the #! : again? Well, it seems obvious from its current behavior that it has to stop some time, so it might as well stop before the first extra exec... I quote the following three lines from toke.c for your amusement: if (line == 1) { if (*s == '#' && s[1] == '!') { if (!in_eval && !instr(s,"perl") && instr(origargv[0],"perl")) { Larry