Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove dependency on Module::Load

  • Loading branch information...
commit 9c82e78543a5c335e843c8f70ca69e0a2ea75178 1 parent b276a54
Leon Timmermans authored
1  META.yml
@@ -14,7 +14,6 @@ requires:
14 14 build_requires:
15 15 Archive::Tar: 0
16 16 ExtUtils::CBuilder: 0.27
17   - Module::Load: 0
18 17 TAP::Harness: 3
19 18 configure_requires:
20 19 ExtUtils::CBuilder: 0.27
13 inc/Library/Build.pm
@@ -7,7 +7,7 @@ use warnings FATAL => 'all';
7 7 our $VERSION = 0.003;
8 8
9 9 use Carp ();
10   -use Module::Load ();
  10 +use File::Spec ();
11 11 use Text::ParseWords ();
12 12
13 13 use Library::Build::Config ();
@@ -152,11 +152,20 @@ sub register_help {
152 152 return;
153 153 }
154 154
  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 +
155 164 sub mixin {
156 165 my ($self, @modules) = @_;
157 166 for my $module (@modules) {
158 167 next if $self->{mixed_in}{$module}++;
159   - Module::Load::load($module);
  168 + $load->($module, 0);
160 169 my $method = "$module\::mixin";
161 170 $self->$method();
162 171 }
1  inc/Library/Build/Compile.pm
@@ -174,3 +174,4 @@ sub mixin {
174 174 return;
175 175 }
176 176
  177 +1;

0 comments on commit 9c82e78

Please sign in to comment.
Something went wrong with that request. Please try again.