http://www.perlmonks.org?node_id=1179118


in reply to how to improve: use MODULE VERSION LIST

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