X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FModuleSender.pm;h=f33a1d5fd4c3bcb870591acfb73b59cbe3e2f144;hp=87f75f119db02f9bdd9c280c15cc329315831817;hb=df8e0ca6a336fb37fd14d40fa345e787bc75b8c2;hpb=542d5b5ca3990695be389d0d497883876c189486 diff --git a/lib/Object/Remote/ModuleSender.pm b/lib/Object/Remote/ModuleSender.pm index 87f75f1..f33a1d5 100644 --- a/lib/Object/Remote/ModuleSender.pm +++ b/lib/Object/Remote/ModuleSender.pm @@ -8,12 +8,19 @@ use Moo; has dir_list => (is => 'lazy'); sub _build_dir_list { - my %core = map +($_ => 1), @Config{qw(privlibexp archlibexp)}; - [ grep !/$Config{archname}$/, grep !$core{$_}, @INC ]; + my %core = map +($_ => 1), grep $_, @Config{ + qw(privlibexp archlibexp vendorarchexp sitearchexp) + }; + [ grep !/\Q$Config{archname}/, grep !/\Q$Config{myarchname}/, grep !$core{$_}, @INC ]; } sub source_for { my ($self, $module) = @_; + if (my $find = Object::Remote::FromData->can('find_module')) { + if (my $source = $find->($module)) { + return $source; + } + } my ($found) = first { -f $_ } map File::Spec->catfile($_, $module), @{$self->dir_list};