Hello Monks,

I have a question about using a second Perl installation on a MacOSX system (Leopard). What I've gleaned about MacOSX on this forum and others is that messing around with the default (i.e. /usr/bin/perl) installation of Perl on a Mac could lead to system breakage. I am interested in messing around with Perl, possibly up to the point of breakage, and I don't want to mess the operating system up. So it seems that the most prudent option is to go with a second installation (I'm assuming in /usr/local/bin/perl).

The small complication is that the perl scripts developed on my mac will probably eventually get put on a linux server and I would prefer not to have to remember to modify the scripts themselves to make sure they work as executables on the server. I have outlined a few options below, along with their pros and cons, but would love some input on any options or consequences that I have missed:

1. Make an alias like perl=/usr/local/bin/perl and always run scripts by typing "perl scriptname". This means I don't have to change the #!/usr/bin/perl line in my scripts and there is no danger of the operating system using the wrong perl installation.

2. Use a #!/usr/local/bin/perl or a use lib statement in all of my perl scripts. The downside is that I would have to remember to change them when I put them up on the server, which I'm sure I would forget to do on a regular basis.

3. Change the PATH variable to search /usr/local/bin before /usr/bin. I am worried that this would also point the operating system to the new perl installation and could break things in the same way as modifying the standard perl installation might.

Does anyone have any suggestions or comments?


Thanks!!!
Sanjuro

In reply to 2nd Perl installation on Mac OSX by sanjuro

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.