Skip to content

Commit 9c82e78

Browse files
committed
Remove dependency on Module::Load
1 parent b276a54 commit 9c82e78

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

META.yml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ requires:
1414
build_requires:
1515
Archive::Tar: 0
1616
ExtUtils::CBuilder: 0.27
17-
Module::Load: 0
1817
TAP::Harness: 3
1918
configure_requires:
2019
ExtUtils::CBuilder: 0.27

inc/Library/Build.pm

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use warnings FATAL => 'all';
77
our $VERSION = 0.003;
88

99
use Carp ();
10-
use Module::Load ();
10+
use File::Spec ();
1111
use Text::ParseWords ();
1212

1313
use Library::Build::Config ();
@@ -152,11 +152,20 @@ sub register_help {
152152
return;
153153
}
154154

155+
my $load = sub {
156+
my ($module, $try) = @_;
157+
my @parts = split /::/, $module;
158+
my $file = $^O eq 'MSWin32' ? join "/", @parts : File::Spec->catfile(@parts);
159+
$file .= ".pm";
160+
$file = VMS::Filespec::unixify($file) if $^O eq 'VMS';
161+
return $try ? eval { require $file } : require $file;
162+
};
163+
155164
sub mixin {
156165
my ($self, @modules) = @_;
157166
for my $module (@modules) {
158167
next if $self->{mixed_in}{$module}++;
159-
Module::Load::load($module);
168+
$load->($module, 0);
160169
my $method = "$module\::mixin";
161170
$self->$method();
162171
}

inc/Library/Build/Compile.pm

+1
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,4 @@ sub mixin {
174174
return;
175175
}
176176

177+
1;

0 commit comments

Comments
 (0)