Acme-CPANModules-CheckingModuleInstalledLoadable
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
my %FallbackPrereqs = (
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Test::More" => 0,
"strict" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
use Module::Load::Conditional qw(check_install);
if (check_install(module => "Foo::Bar")) {
# Foo::Bar is installed
}
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 }) {
# Foo::Bar can be loaded (and was loaded!)
}
ACME::CPANMODULES ENTRIES
Module::Path
Author: NEILB <https://metacpan.org/author/NEILB>
Module::Path::More
Author: PERLANCAR <https://metacpan.org/author/PERLANCAR>
lib/Acme/CPANModules/CheckingModuleInstalledLoadable.pm view on Meta::CPAN
<pm:Module::Installed::Tiny>'s `module_installed`:
use Module::Load::Conditional qw(check_install);
if (check_install(module => "Foo::Bar")) {
# Foo::Bar is installed
}
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 }) {
# Foo::Bar can be loaded (and was loaded!)
}
_
tags => ['task'],
entries => [
{
module=>'Module::Path',
},
{
lib/Acme/CPANModules/CheckingModuleInstalledLoadable.pm view on Meta::CPAN
L<Module::Installed::Tiny>'s C<module_installed>:
use Module::Load::Conditional qw(check_install);
if (check_install(module => "Foo::Bar")) {
# Foo::Bar is installed
}
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 }) {
# Foo::Bar can be loaded (and was loaded!)
}
=head1 ACME::CPANMODULES ENTRIES
=over
=item L<Module::Path>
Author: L<NEILB|https://metacpan.org/author/NEILB>
t/00-compile.t view on Meta::CPAN
$^X, @switches, '-e', "require q[$lib]"))
if $ENV{PERL_COMPILE_TEST_DEBUG};
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
and not eval { +require blib; blib->VERSION('1.01') };
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
( run in 3.875 seconds using v1.01-cache-2.11-cpan-98e64b0badf )