Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove dependency on Module::Load

  • Loading branch information...
commit 9c82e78543a5c335e843c8f70ca69e0a2ea75178 1 parent b276a54
Leon Timmermans authored
Showing with 12 additions and 3 deletions.
  1. +0 −1  META.yml
  2. +11 −2 inc/Library/Build.pm
  3. +1 −0  inc/Library/Build/Compile.pm
1  META.yml
View
@@ -14,7 +14,6 @@ requires:
build_requires:
Archive::Tar: 0
ExtUtils::CBuilder: 0.27
- Module::Load: 0
TAP::Harness: 3
configure_requires:
ExtUtils::CBuilder: 0.27
13 inc/Library/Build.pm
View
@@ -7,7 +7,7 @@ use warnings FATAL => 'all';
our $VERSION = 0.003;
use Carp ();
-use Module::Load ();
+use File::Spec ();
use Text::ParseWords ();
use Library::Build::Config ();
@@ -152,11 +152,20 @@ sub register_help {
return;
}
+my $load = sub {
+ my ($module, $try) = @_;
+ my @parts = split /::/, $module;
+ my $file = $^O eq 'MSWin32' ? join "/", @parts : File::Spec->catfile(@parts);
+ $file .= ".pm";
+ $file = VMS::Filespec::unixify($file) if $^O eq 'VMS';
+ return $try ? eval { require $file } : require $file;
+};
+
sub mixin {
my ($self, @modules) = @_;
for my $module (@modules) {
next if $self->{mixed_in}{$module}++;
- Module::Load::load($module);
+ $load->($module, 0);
my $method = "$module\::mixin";
$self->$method();
}
1  inc/Library/Build/Compile.pm
View
@@ -174,3 +174,4 @@ sub mixin {
return;
}
+1;
Please sign in to comment.
Something went wrong with that request. Please try again.