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 !$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};