in reply to warnings and grep problem

The pattern doesn't match for every key and value of the hash, causing $2 to be undefined for such cases. To resolve that alone:
sub _find_modules { my $dir = shift ; my ($inst) = ExtUtils::Installed->new(); my $packlist = $inst->packlist("My_Package"); return grep { /.*?\Q$dir\E\w+\.pm$/ and s/(.*?\Q$dir\E)(\w+)(\.pm) +$/$2/; } %$packlist ; }

-M

Free your mind