[wellylug] Perl code trouble

Rob Stockley mowgli at clear.net.nz
Wed Oct 1 17:29:55 NZST 2003


Thanks. It's nice to read an explanation full on facts and not drawing
too much attention to my "shot from the hip" blooper :) It appears that
today was not a waste - I have learnt something.

Rob

On Wed, 2003-10-01 at 17:16, Stephen Judd wrote:
> Quoting Rob Stockley <mowgli at clear.net.nz>:
> 
> > Don't you still need the first line to be
> > 
> > #!/usr/bin/perl
> > 
> > or something similar?
> 
> You only need a shebang on under Unix, where you invoke the file by name from
> the command line, thus:
> 
> stephen$ myscript.pl
> 
> If you pass the name as an argument to perl , you don't need shebang:
> 
> stephen$ perl myscript.pl
> 
> And Windows uses the extension to figure it out.
> 
> c:> myscript.pl
> 
> (but no .pl, no luck!).
> 
> Shebang lines are a nice bit of hackery to let Unix shells know what interpreter
> to use on executable text files, so the above is also valid for python, tcl,
> bash, etc.
> 
> Stephen



More information about the wellylug mailing list