summaryrefslogtreecommitdiff
path: root/lib/autouse.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/autouse.pm')
-rw-r--r--lib/autouse.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/autouse.pm b/lib/autouse.pm
index 7fb318be1c..15335b7cf9 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"