http://qs1969.pair.com?node_id=321911


in reply to What's #! got to do with it?

I bet you're invoking the program on the shell like:

$ perl file.pl

In which case the shebang doesn't matter, and never has. It only matters if you're doing:

$ ./file.pl

Or if you're executing it on a web server without an embedded interpreter (like mod_perl).

The shebang is a magic number (see man magic) which tells the operating system to execute the command on the line with the given options to intepret the rest of the file. Since the perl file.pl form already has an interpeter attached to the code, the #! is considered just another comment (sort of . . . )

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated