Abigail,

>>Assuming the various versions of Perl weren't configured by monkeys typing random characters, Unfortunately, that's the way it's been for all of my clients. :)

Also, I need to have a central repository for the custom libraries. It's not a good idea to take on the maintenance of updating code on 11 platforms if you do not have to.

My system was initially setup for a hybrid environment of 5.005_03 and 5.6.1. I have to reference some custom libraries that were written for 5.005_03. Furthermore, I have to backup to make sure my system fully supports 5.005_03 on all 11 platforms.

Note: The system is centrally located, so any changes on the UNIX/Linux side of the house will affect all of those platforms.

After making changes on aix due to referencing higher versions IO 5.6.1 library problems, my system started working correctly on Perl 5.005_03. Solaris is still running Perl 5.6.1. That is all it has installed. Other than the old Perl executable I previously mentioned.

So,when I tried running the same code on Solaris, it barfed because of the Perl 5.6.1 system is expecting Perl 5.6.1 versions of IO to be in PERL5LIB. Perl is in many different locations on the various UNIX/Linux platforms, but in the same place for the 5 Windows + Netware platforms.

One question is can I have Perl switch on the libraries on the fly with a BEGIN statement? Something like:

use Config; $PLATFORM = $Config{'osname'}; if (($PLATFORM =~ /^MSWin32/i) || ($PLATFORM =~ /^solaris/i)) { # use Perl 5.6.1 libraries BEGIN { @PERL_SHARE = ( "/foo/custom/perl/lib/Custom_mods5.6.1", ); unshift(@INC, @PERL_SHARE); }; } else { # use Perl 5.005_03 libraries BEGIN { @PERL_SHARE = ( "/foo/custom/perl/lib/Custom_mods5.005_03", ); unshift(@INC, @PERL_SHARE); }; }

Does this make more sense? The question is, what would the best practice be??

-P0w3rK!d


In reply to Re: Re: How to handle Cross-platform Perl, modules, and versioning by P0w3rK!d
in thread How to handle Cross-platform Perl, modules, and versioning by P0w3rK!d

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.