diff options
author | Chris Williams <chris@bingosnet.co.uk> | 2009-10-23 12:30:26 +0100 |
---|---|---|
committer | Chris Williams <chris@bingosnet.co.uk> | 2009-10-23 12:30:26 +0100 |
commit | 1823d11bd0507e10ace531e59b0e992b16466120 (patch) | |
tree | 2e07f7f3135219ad477175484ee7afcd4adebe86 /cpan | |
parent | 6cf7238579bd512306a71f8d84f26589241691ff (diff) | |
download | perl-1823d11bd0507e10ace531e59b0e992b16466120.tar.gz |
Updated Module::Load::Conditional to cpan version 0.31_01
Changes for 0.31_01 Fri Oct 23 09:47:12 BST 2009
=================================================
* Added DEPRECATED and support for determining if
a core module is loaded from perl lib path and
setting uptodate accordingly.
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm index 47bafe1ead..4754011b36 100644 --- a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm +++ b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm @@ -14,12 +14,13 @@ use version; use constant ON_VMS => $^O eq 'VMS'; BEGIN { - use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK + use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK $DEPRECATED $FIND_VERSION $ERROR $CHECK_INC_HASH]; use Exporter; @ISA = qw[Exporter]; - $VERSION = '0.30'; + $VERSION = '0.31_01'; $VERBOSE = 0; + $DEPRECATED = 0; $FIND_VERSION = 1; $CHECK_INC_HASH = 0; @EXPORT_OK = qw[check_install can_load requires]; @@ -136,6 +137,9 @@ uptodate will always be true if the module was found. If no parsable version was found in the module, uptodate will also be true, since C<check_install> had no way to verify clearly. +See also C<$Module::Load::Conditional::DEPRECATED>, which affects +the outcome of this value. + =back =cut @@ -208,7 +212,7 @@ sub check_install { ($fh) = $dir->[0]->($dir, $file, @{$dir}{1..$#{$dir}}) } elsif (UNIVERSAL::can($dir, 'INC')) { - ($fh) = $dir->INC->($dir, $file); + ($fh) = $dir->INC($file); } if (!UNIVERSAL::isa($fh, 'GLOB')) { @@ -300,6 +304,16 @@ sub check_install { : 0; } + if ( $DEPRECATED and version->new($]) >= version->new('5.011') ) { + require Module::CoreList; + require Config; + + $href->{uptodate} = 0 if + exists $Module::CoreList::version{ 0+$] }{ $args->{module} } and + Module::CoreList::is_deprecated( $args->{module} ) and + $Config::Config{privlibexp} eq $href->{dir}; + } + return $href; } @@ -600,6 +614,15 @@ This holds a string of the last error that happened during a call to C<can_load>. It is useful to inspect this when C<can_load> returns C<undef>. +=head2 $Module::Load::Conditional::DEPRECATED + +This controls whether C<Module::Load::Conditional> checks if +a dual-life core module has been deprecated. If this is set to +true C<check_install> will return false to C<uptodate>, if +a dual-life module is found to be loaded from C<$Config{privlibexp}> + +The default is 0; + =head1 See Also C<Module::Load> |