in reply to different first line in perl
I think it's just a commented out piece of code. Perl only gives special meaning to #!, not to # by iteslf, unless you consider comments "special" ;) . And the `backticks` containing which perl are the same as qx/which perl/, which is also a little wierd because the command is executed in void context. ...actually it's not executed at all because it's commented out.
I don't know the nuances of Solaris ksh, but perlrun doesn't give any indication that #`....` would have some special meaning aside from a comment.
Response to OP's update:
Now it makes sense. With the #! (as you've indicated in your update), the shell invokes the backticks (perl doesn't), essentially expanding `which perl` to something along the lines of "/usr/bin/perl" (or whatever the output of "which perl" happens to be on your configuration). perlrun does state that whatever follows #! on the first line will be executed, so it's not surprising this should work in a unix flavored environment.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: different first line in perl
by Anonymous Monk on Sep 29, 2006 at 12:03 UTC |