in reply to Re: Issue with #!usr/bin/perl
in thread Issue with #!usr/bin/perl
Actually on Windows, the shebang line is not ignored. The Operating System ignores it, but Perl pays attention. Compare:
#!/usr/bin/perl print undef;
with:
#!/usr/bin/perl -w print undef;
The former issues no warning; the latter warns about using an uninitialized value.
This is because in Perl, the shebang line performs two roles. It's used by Unix-like operating systems as a "dispatch mechanism" - to decide which program should interpret the script. And on all operating systems Perl parses it looking for command-line options. It doesn't honour all command line options found there (e.g. -M) but does some (like -w and -t).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Issue with #!usr/bin/perl
by DrHyde (Prior) on Mar 14, 2013 at 11:25 UTC | |
|
Re^3: Issue with #!usr/bin/perl
by nagalenoj (Friar) on Mar 13, 2013 at 09:49 UTC | |
|
Re^3: Issue with #!usr/bin/perl
by Anonymous Monk on Feb 02, 2018 at 14:54 UTC | |
by Anonymous Monk on Feb 02, 2018 at 14:57 UTC |