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.
[mumbai:~/Sites/test] punkish% which perl /usr/bin/perl [mumbai:~/Sites/test] punkish% perl -v This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level .. [mumbai:~/Sites/test] punkish% ~/bin/perl -v This is perl, v5.8.7 built for darwin-thread-multi-2level .. [mumbai:~/Sites/test] punkish% perl -c test.pl Can't locate CGI/Simple.pm in @INC (@INC contains: /System/Library/Per +l/5.8.1/darwin-thread-multi-2level /Syste.. [mumbai:~/Sites/test] punkish% ./test.pl Content-Type: text/html; charset=ISO-8859-1 <style type="text/css"> .strike {text-decoration:line-through;} .hilite .. [mumbai:~/Sites/test] punkish% ~/bin/perl ./test.pl Content-Type: text/html; charset=ISO-8859-1 <style type="text/css"> .strike {text-decoration:line-through;} .hilite ..
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.
In reply to #! -- why doth thou exist? by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |