usr::share::perl5::venUserpusr::share::perl5::vendor_perl::NOCpulse::Module(3)NAMENOCpulse::Module - safely loads a Perl module
SYNOPSIS
use NOCpulse::Module;
...
my $error = NOCpulse::Module::load($moduleName, $libDir);
if ($error) {
die "Cannot load $moduleName from $libDir: $error\n";
}
my @errors = NOCpulse::Module::load($moduleName, $libDir, 'NOCpulse::PlugFrame');
if (@errors) {
die "Cannot load $moduleName from $libDir: ".join(' ', @errors)."\n";
}
DESCRIPTION
Provides methods to test if a Perl module is loaded, and to attempt to
load one without blowing up if it cannot be found.
MODULE METHODS
load($moduleName [, $libDir [, $fallbackPackage])
First checks if the module has been loaded and returns true if so.
Otherwise adds $libDir to the library path and tries to "require"
the module ($libDir can be either a scalar or a ref to an array of
scalars). If that fails, and $fallbackPackage is provided (which,
again, can be either a scalar or an ref to an array of scalars),
remembers the first error and tries to "require" the module in the
fallback package. If that also fails, that error and the previous
are returned. If there is no fallback package and there is an
error, returns false and in array context returns (0 ,
@error_messages).
isLoaded($moduleName)
Returns defined if the module named $moduleName is known to Perl,
undef otherwise.
perl v5.14.0usr::share::perl5::vendor_perl::NOCpulse::Module(3)