|Perl Monk, Perl Meditation|
Shebang Line (was: different first line in perl)by Intrepid (Deacon)
|on Sep 29, 2006 at 10:13 UTC||Need Help??|
greatshots sought to understand that which is described by the following text:
[...] in a very old application called npr [...] I have picked the following snippet from there and ask for your valueable inputs about it. #!`which perl` The above code works fine in Solaris ksh. Is that a appreciatable line in perl ? have anyone of you already used such a line in your perl codes ? can I use those line in my future codes ?
I would say not. It is a thing i don't think i have seen before, but it does something similar to what is done by a much more recent and sound first-line: #! /usr/bin/env perl
Points to understand:
Caveat: I am not a Unix guru of 30 years experience and I don't warrantee that every aspect of this reply is correct.
If you want the best advice I can give you based on my own understanding, use #! /usr/bin/env perl (but no switches allowed after 'perl'). The space between the ! and the /usr/bin... is deliberate. It caters to the dysfunction of a legacy Unix flavor (I think it is an HPUX) that didn't do correct kernel intepretation of the shebang without the space. It does not harm correct operation of any other known Unix flavor.
--Words can be slippery, so consider who speaks as well as what is said; know as much as you can about the total context of the speaker's participation in a forum over time, before deciding that you fully comprehend the intention behind those words. If in doubt, ask for clarification before you 'flame'.