X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fautouse.pm;h=15335b7cf9b88bacf979f4bbf80ba72e0a002195;hb=f1c689a86c4d291fc38042ab6974540507ad0175;hp=7fb318be1c9cfd7875beda9dfc4ef603641ce290;hpb=8d5464a9414375d879690bea0e51f7fdfcb0f619;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/autouse.pm b/lib/autouse.pm index 7fb318b..15335b7 100644 --- a/lib/autouse.pm +++ b/lib/autouse.pm @@ -39,7 +39,7 @@ sub import { my $closure_import_func = $func; # Full name my $closure_func = $func; # Name inside package - my $index = rindex($func, '::'); + my $index = index($func, '::'); if ($index == -1) { $closure_import_func = "${callpkg}::$func"; } else { @@ -54,6 +54,7 @@ sub import { die if $@; vet_import $module; } + no warnings 'redefine'; *$closure_import_func = \&{"${module}::$closure_func"}; print "autousing $module; " ."imported $closure_func as $closure_import_func\n"