Module::Load::Conditional is a Perl module to lookup module information / loading at runtime.
SYNOPSIS
use Module::Load::Conditional qw[can_load check_install requires];
my $use_list = {
CPANPLUS => 0.05,
LWP => 5.60,
'Test::More' => undef,
};
print can_load( modules => $use_list )
? 'all modules loaded successfully'
: 'failed to load required modules';
my $rv = check_install( module => 'LWP', version => 5.60 )
or print 'LWP is not installed!';
print 'LWP up to date' if $rv->{uptodate};
print "LWP version is $rv->{version}
";
print "LWP is installed as file $rv->{file}
";
print "LWP requires the following modules to be installed:
";
print join "
", requires('LWP');
### allow M::L::C to peek in your %INC rather than just
### scanning @INC
$Module::Load::Conditional::CHECK_INC_HASH = 1;
### reset the 'can_load' cache
undef $Module::Load::Conditional::CACHE;
### don't have Module::Load::Conditional issue warnings --
### default is '1'
$Module::Load::Conditional::VERBOSE = 0;
### The last error that happened during a call to 'can_load'
my $err = $Module::Load::Conditional::ERROR;
Module::Load::Conditional provides simple ways to query and possibly load any of the modules you have installed on your system during runtime.
It is able to load multiple modules at once or none at all if one of them was not able to load. It also takes care of any error checking and so forth.
Product's homepage
Requirements:
· Perl