X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=blobdiff_plain;f=perl.prov;h=a494480010caf026594bf8edb15fbf22dc243e03;hp=21da4a8b8bedfcf782e071c7239008712300a6ef;hb=24123ddd1679b63fae2b8eb50c7c664787b245d7;hpb=4e5a58847f0f3f33a51e18099c58b4b7142d3b63 diff --git a/perl.prov b/perl.prov index 21da4a8..a494480 100644 --- a/perl.prov +++ b/perl.prov @@ -31,9 +31,12 @@ use Safe; sub new { my $class = shift; my $self = { - inc => [ sort { length $b cmp length $a } grep m#^/#, @INC ], + inc => [ + sort { length $b cmp length $a } grep m#^/#, + map { y#/#/#s; s#/$##; $_ } @INC + ], provide => {}, - safe => Safe->new, + safe => Safe->new, @_, }; bless $self, $class; @@ -57,7 +60,7 @@ sub process_file { # if the file lives under @INC, we can # obtain the package name from it's path for (@{ $self->{inc} }) { - if ($file =~ m#\Q$_\E/?(.+)$#) { # we can't use ^ here + if ($file =~ m#\Q$_\E/(.+)$#) { # we can't use ^ here $package = $1; if ($package !~ s/\.pm$//) { # it's a *.pl