Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

G'day smile4me,

It's not clear whether your "CTB folks" want the newer/additional modules for just their own use ("try new things, build new tools, etc.") or to build code that will subsequently become production code.

If just for their own use, I'd suggest setting PERL5LIB (in .bash_profile, or equivalent) and that's all that needs to be done. From "perlrun: ENVIRONMENT":

"A list of directories in which to look for Perl library files before looking in the standard library and the current directory."

If production code, your "use autodie 2.29" example would be the better option.

Manipulating @INC is fraught with problems. Reversing it, and you end up with '.' at the front of the list: not a good idea. More sophisticated manipulation, like moving the first four standard paths (site/non-site + arch/non-arch) with

BEGIN { @INC = @INC[4 .. $#INC-1, 0 .. 3, $#INC] }

would change the @INC you show to

'/usr/foss/packages/cpan-basics/perl-5.20.3/lib/perl5/x86_64-linux-thr +ead-multi-ld', '/usr/foss/packages/cpan-basics/perl-5.20.3/lib/perl5', '/usr/foss/packages/cpan-basics/perl-5.20.3/lib/perl5/site_perl', '/usr/foss/packages/foss-perllib', '/usr/foss/packages/perl/perl-5.20.3/lib/site_perl/5.20.3/x86_64-linux +-thread-multi', '/usr/foss/packages/perl/perl-5.20.3/lib/site_perl/5.20.3', '/usr/foss/packages/perl/perl-5.20.3/lib/5.20.3/x86_64-linux-thread-mu +lti-ld', '/usr/foss/packages/perl/perl-5.20.3/lib/5.20.3', '.'

but falls over if the base @INC ever changes (e.g. you add vendor_perl paths) or the environment changes (e.g. PERL5LIB or PERLLIB are set).

— Ken


In reply to Re: how to improve: use MODULE VERSION LIST by kcott
in thread how to improve: use MODULE VERSION LIST by smile4me

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 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? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2021-08-02 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (28 votes). Check out past polls.

    Notices?