The Solaris, Perl 5.8 and use 5.005 post reminded me of a question I have. It's really about linking to the Perl executable on Linux and similar systems. I'm not any kind of expert and I'm unsure about the real-life differences on how links ( created with ln ) to executables are handled. Almost all of my perl scripts begin with this line:

#!/usr/bin/perl -w

but the actual location of the perl executable on most (but not all) my boxes is /usr/local/bin.

So here's my question: Is it preferred, just okay, or totally horrible if I put a symbolic (rather than hard) link in /usr/bin which points to /usr/local/bin/perl ? Is there a reason I can't, or shouldn't make it a symbolic link, rather than a hard link?

I'd like to make sure I have only one "perl" which runs, and it's always the latest version (if I want a specific version, I can call /usr/local/bin/perl5.6.1 or whatever). Since the current versions install into /usr/local/bin, I'd like to put a link in /usr/bin which points to the current version. If it's not obvious, I don't want to go through and edit all my old scripts.

This must be a common task and I want to do it right. Is there a preferred way to do it? Thanks.


In reply to Linking to the perl executable by doran

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.