in reply to Clarify My doubt on #!/usr/local/bin/perl
The #! characters are interpreted by linux/unix shells to mean "run whatever program follows, then pass the text on all subsequent lines to that program". It's a simple way of constructing scripts in any language, merely by defining which interpreter should be used on the first line of the script.
As the previous poster attests, you don't need it in windows. That's because windows is different to linux in that it determines which program to run your file by the file extension (in most cases this will be .pl on your system). Alternatively you can run your perl scripts by typing "perl <filename>".
There is one situation where you must provide the "hash-bang" on scripts in windows - this is in Apache for Win32, when executing perl CGI scripts. Apparently Apache looks for which interpreter to use based on the first line of any CGI scripts.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Clarify My doubt on #!/usr/local/bin/perl
by ysth (Canon) on Jun 01, 2005 at 05:43 UTC | |
[OT] Re^2: Clarify My doubt on #!/usr/local/bin/perl
by fokat (Deacon) on Sep 20, 2005 at 14:25 UTC |