My reading of perlrun suggests that Perl's behaviour is subtle:
The #! line is always examined for switches as the line is being parsed. Thus, if you're on a machine that allows only one argument with the #! line, or worse, doesn't even recognize the #! line, you still can get consistent switch behavior regardless of how Perl was invoked...
appears to say that:
if you happen to be running on a system that implements the #! trick, and invoke your Perl program in a way that causes the system to use the #!, then that's fine -- you'll get as many switches and such as the system is prepared to give you.
however, in any event Perl will parse the #! line itself and honour switches and stuff. So, if the system doesn't do it, or you run your program by (for example) perl my_wonderful_program.pl ...., you still get the switches from the #!.
The documentation goes on to discuss what happens if switches appear both in the command line and in the #!, and to tell you that perl needs to appear somewhere on the line for Perl to be interested in it.
So, Perl does more or less what you want. It has partly adopted the #! convention, so that even if it has no bearing on where the perl interpreter is run from, it still affects switches -- in a system independent manner.
Update: except for -T as brother Hue-Bond points out below :-(
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link
or How to display code and escape characters
are good places to start.