Retract #10243.
Jarkko Hietaniemi [Tue, 29 May 2001 20:12:09 +0000 (20:12 +0000)]
p4raw-id: //depot/perl@10300

lib/autouse.pm

index 7fb318b..15335b7 100644 (file)
@@ -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"