Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: shebang arguments

by friedo (Prior)
on Jul 03, 2008 at 00:21 UTC ( #695248=note: print w/ replies, xml ) Need Help??


in reply to Re: shebang arguments
in thread shebang arguments

Another difference is that if someone runs the perl command against your script then the shebang line will be ignored while "use warnings" will still be enforced.

It may be ignored by the shell, but it isn't ignored by perl.

foo.pl: #!/usr/bin/perl -w $x = $y . $z; $ ./foo.pl Name "main::y" used only once: possible typo at ./foo.pl line 3. Name "main::z" used only once: possible typo at ./foo.pl line 3. Name "main::x" used only once: possible typo at ./foo.pl line 3. Use of uninitialized value in concatenation (.) or string at ./foo.pl +line 3. Use of uninitialized value in concatenation (.) or string at ./foo.pl +line 3. $ perl foo.pl Name "main::y" used only once: possible typo at foo.pl line 3. Name "main::z" used only once: possible typo at foo.pl line 3. Name "main::x" used only once: possible typo at foo.pl line 3. Use of uninitialized value in concatenation (.) or string at foo.pl li +ne 3. Use of uninitialized value in concatenation (.) or string at foo.pl li +ne 3.

BTW, you can use perl -X to force it to ignore -w on the shebang, if you want.

Replies are listed 'Best First'.
Re^3: shebang arguments
by Argel (Prior) on Jul 03, 2008 at 21:12 UTC
    Ahh, so perl actually checks! Nice!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://695248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2016-07-24 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.