Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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:>*

In reply to Re^4: Shebang Inside the coding ? by Perl Mouse
in thread Shebang Inside the coding ? by vennirajan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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> <u> <ul>
  • 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 intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2024-03-28 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found