only::latest - Always use the latest version of a module in @INC
This document describes version 0.01 of only::latest, released November 4, 2003.
use lib "/some/dir"; use only::latest; use DBI; # use "/some/dir/DBI.pm" only if it's newer than system's
This module is for people with separately-maintained INC directories containing overlapping modules, who wishes to always use the latest version of a module, regardless of the directory it is in.
If you use or require a module living in more than one directory, the one with the highest $VERSION is preferred, and its directory will be tried first during the next time. If there is a tie, the first-tried one is used.
use
require
$VERSION
The implementation puts a hook in front of @INC; this means it should come after all use lib statements.
@INC
use lib
If you wish to limit this module to some specific targets, list them as the import arguments, like this:
use only::latest qw(CGI CGI::Fast); use DBI; # not affected
Autrijus Tang <autrijus@autrijus.org>
Part of code derived from ExtUtils::MM_Unix.
Copyright 2003 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install only::latest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm only::latest
CPAN shell
perl -MCPAN -e shell install only::latest
For more information on module installation, please visit the detailed CPAN module installation guide.