This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[ID 19991112.002] patch: Exporter.pm not reporting path
[perl5.git] / lib / Exporter / Heavy.pm
index 95ffc55..1f9b432 100644 (file)
@@ -213,7 +213,8 @@ sub require_version {
     my $version = ${"${pkg}::VERSION"};
     if (!$version or $version < $wanted) {
        $version ||= "(undef)";
-       my $file = $INC{"$pkg.pm"};
+           # %INC contains slashes, but $pkg contains double-colons.
+       my $file = (map {s,::,/,g; $INC{$_}} "$pkg.pm")[0];
        $file &&= " ($file)";
        require Carp;
        Carp::croak("$pkg $wanted required--this is only version $version$file")