Name : perl-Acme-CPANModules-CheckingModuleInstalledLoadable
| |
Version : 0.002
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.7
| Date : 2024-08-05 17:38:17
|
Group : Unspecified
| Source RPM : perl-Acme-CPANModules-CheckingModuleInstalledLoadable-0.002-1.7.src.rpm
|
Size : 0.03 MB
| |
Packager : (none)
| |
Summary : List of modules to check if a module is installed or loadable
|
Description :
If you simply want to check that a module\'s \'.pm\' file is locatable in \'AATTINC\', you can just do something like:
my $mod = \"Foo/Bar.pm\"; for my $dir (AATTINC) { next if ref $dir; if (-f \"$dir/$mod\") { print \"Module $mod is installed\"; last; } }
Or you can use something like Module::Path or Module::Path::More which does similar to the above.
A module can also be loaded from a require hook in ~AATTINC~ (like in the case of fatpacked or datapacked script) and the above methods does not handle it. Instead, you\'ll need to use Module::Load::Conditional\'s \'check_install\' or Module::Installed::Tiny\'s \'module_installed\':
use Module::Load::Conditional qw(check_install); if (check_install(module => \"Foo::Bar\")) { }
The above does not guarantee that the module will be loaded successfully. To check that, there\'s no other way but to actually try to load it:
if (eval { require Foo::Bar; 1 }) { }
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/openSUSE_Tumbleweed/noarch |