-I switches on shebang line

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm sure something in perldoc perlrun is relevant to my question, but
I can't figure out what.  Please give me a kick in the pants.

$ cat foo.pl
#!/home/xho/perl_10/bin/perl -Ifoo -Ibar -l
print foreach @INC;

$ ./foo.pl
foo -Ibar -l

So, why are foo and bar put at the end of @INC, instead of at the beginning
where perlrun says they should?

And why is "foo -Ibar -l" put at the front of @INC, as if all of the
shebang line after the first word were put in quotes?

This behavior doesn't seem specific to 5.10.0, it is seen in various 5.8
as well.  If invoked like "perl foo.pl" then the foo and bar still
go at the end, rather than beginning, but the weird first entry is omitted.


-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Site Timeline