Perl: the Markov chain saw | |
PerlMonks |
Re^3: Shebang Inside the coding ?by blazar (Canon) |
on Jan 16, 2006 at 12:55 UTC ( [id://523485]=note: print w/replies, xml ) | Need Help?? |
Because your editor, whatever it is, however good it is, is not perl, and it is a well known axiom that "nothing but perl can parse Perl". So do not trust your editor's syntax highlighter. Trust your perl parser! Of course this simple case is on the border line, so to say, and probably other syntax highlighters do a better job of only marking a shebang looking like line like a shebang if it actually occurs at the beginning of the script. But in general expect similar "mistakes". Occasionally even perl has a difficulties parsing Perl and you need to help it by disambiguating suitably! Of course both the shebang line and a "regular" comment are just comments to perl itself. Well, not quite: I remember having read that perl does not fully trust the OS interpreting the shebang line and re-reads it, which is the reason why stuff like
does work also under (osen that do not do shebang line interpretation, like) Windows.
In Section
Seekers of Perl Wisdom
|
|