use lib sub { for (qw/Foo.pm Bar.pm Baz.pm/) { if ($_[1] eq $_) { $_[1] =~ s/\./-$^O./; last; } } # let perl go on searching the 'faked' .pm! undef; };