Make your shebang line #!/usr/bin/env perl and then whichever perl is found first in your PATH environment variable will be the one used. perlbrew is its own beast. You put some perlbrew vars in your profile script, then perlbrew manages multiple perl installations. Try 'perlbrew available', 'perlbrew install 5.22.0' and then 'perlbrew switch 5.22.0'. If you did it right, `which perl`, should show that you are using one of the perlbrew managed perls.

Each Perl installation by default will have a compiled @INC that refers to its own local installed modules. So generally if you don't mess around with it, every installation will maintain its own modules. The overall goal is that all you have to do is either use perlbrew to switch between perls or change your PATH variable. If you think that is a worthy goal you will not use /usr/bin/perl in your shebang lines, nor /home/perl5/perlbrew/perls/perl-5.20.1/bin/perl because that will tie you to that file.

By default the ln command makes a hard link which is a pointer to the original file. You cannot span file systems with hard links. You probably want the '-s' option, which is a symbolic/soft link. Accomplishes same thing, but extra lookup. If you have two hard links to a file, deleting one will just decrease your link count by one. You will still be able to access using the other one. With two soft links, deleting the real file will cause the soft link to not work.


In reply to Re: How to make symlink to new upgraded Perl? by trippledubs
in thread How to make symlink to new upgraded Perl? by bulrush

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.