Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Issue with #!usr/bin/perlby tobyink (Canon) |
on Mar 13, 2013 at 07:56 UTC ( [id://1023137]=note: print w/replies, xml ) | Need Help?? |
Actually on Windows, the shebang line is not ignored. The Operating System ignores it, but Perl pays attention. Compare:
with:
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).
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|