in reply to #! -- why doth thou exist?

Howdy!

The #! line is a general mechanism for an executable script to name its interpreter to the system. Perl does look at it and will respect flags on the line, even if you execute your script via "perl myscript".

However, the part where it specifies the path to perl only has effect when the script is executed directly as in "myscript".

Your mileage may vary on non-unix systems.

yours,
Michael

Replies are listed 'Best First'.
Re^2: #! -- why doth thou exist?
by ww (Archbishop) on Aug 25, 2005 at 13:59 UTC
    true, and note:
      s/Your mileage may vary on non-unix systems/Your mileage WILL vary on windows/

      Although you will need a shebang if you are running a perl CGI script under Apache over Windows...

      #!D:\perl\bin\perl.exe -T use strict; use CGI; ...blah...