Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Shebang Inside the coding ?

by Perl Mouse (Chaplain)
on Jan 16, 2006 at 19:36 UTC ( #523582=note: print w/replies, xml ) Need Help??


in reply to Re^3: Shebang Inside the coding ?
in thread Shebang Inside the coding ?

It's not a matter of "trusting". The kernel will only do something with the shebang line if 1) it's a Unix kernel and 2) the program was executed directly. Furthermore, not every kernel will do the same - different kernels have different limits on the number of significant characters.

So, to make things equal, perl will pay attention the the first line - if it's a shebang line, it will look which command follows the shebang line. If it doesn't look like a perl, it will start this command, else it will look which options have been passed.

It's also not a matter of re-reading. It has to read the first line anyway. (Other interpreters would just discard the first line - it's not a coincidence that interpreters (*) line Perl, shells and Python use the # as their comment character.

(*) Called interpreter because they can read a program on their STDIN and execute it.

Perl --((8:>*

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2020-10-26 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (250 votes). Check out past polls.

    Notices?