Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Supressing warnings

by morgon (Deacon)
on Jul 22, 2010 at 23:27 UTC ( #850939=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Supressing warnings
in thread Supressing warnings

Yeah, ok there may be some uses like yours (which I would consider a hack), but in general (at least that would be the behaviour of least surprise) you (ok: I) would expect that when you run a script as "a.pl" you get your command-line flags from the shebang-line and when you run it as "perl <whatever flags> a.pl" your get it from - well - the command line.

With this behaviour I cannot run a script with different flags without having to modify it if it contains a shebang lines with flags.

Do Python and Ruby do this as well?


Comment on Re^4: Supressing warnings
Re^5: Supressing warnings
by almut (Canon) on Jul 23, 2010 at 00:14 UTC
    With this behaviour I cannot run a script with different flags without having to modify it if it contains a shebang lines with flags.

    You could also argue the other way round, i.e. it provides for consistency independently of how exactly the interpreter is being invoked — in particular as there are some operating system that don't handle shebangs (one rather commonly used one is among them...).

    And some options might be an integral part of a script, or at least important to its proper functioning — like -n, -p, -l, -C (which didn't work on the shebang line until recently, btw), etc. — so I would rather want them to remain in effect when I call the script as perl myscript.pl .

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-09-15 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls