|P is for Practical|
#! -- why doth thou exist?by punkish (Priest)
|on Aug 25, 2005 at 13:37 UTC||Need Help??|
punkish has asked for the
wisdom of the Perl Monks concerning the following question:
which perl is an oft discussed subject, but I can't determine the reason for the observed behavior as follows --
On my Mac, I finally did the way I should have always done it... started with a clean machine (OS X 10.3 with perl v5.8.1-RC3), left the stock perl alone, installed Activestate perl v5.8.7 under usr/local/Activestate..., linked the AS perl to ~/bin/perl, and changed my shebang lines to #!/Users/punkish/bin/perl.
So, in the terminal I get the factory-installed perl because it is in the path, while my own perl is not in the path. I can even understand why the shebang line is ignored when I call perl test.pl (although it seems that the purpose of the shebang line is defeated -- "what is the purpose of the shebang line?"). But, to confirm the "sense" of the behaviour, shebang line comes into play only when the perl interpreter is not called directly?
Interestingly, while #!/Users/punkish/bin/perl works, and ~/bin/perl test.pl works, #!~/bin/perl fails. So, seems like shell expansion of ~ is not done in a shebang line.
when small people start casting long shadows, it is time to go to bed