Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

[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.

--

when small people start casting long shadows, it is time to go to bed

In reply to #! -- why doth thou exist? by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found