Date: Thu, 18 Aug 2005 08:13:24 +0400
Message-ID: <
20050818041324.GO19097@solemn.turbinal.org>
Subject: autouse.pm: check stub, use goto in stub
From: Alexey Tourbin <at@altlinux.ru>
Date: Thu, 18 Aug 2005 09:06:20 +0400
Message-ID: <
20050818050620.GP19097@solemn.turbinal.org>
p4raw-id: //depot/perl@25302
#use strict; # debugging only
use 5.003_90; # ->can, for my $var
-$autouse::VERSION = '1.04';
+$autouse::VERSION = '1.05';
$autouse::DEBUG ||= 0;
my $load_sub = sub {
unless ($INC{$pm}) {
- eval {require $pm};
- die if $@;
+ require $pm;
vet_import $module;
}
no warnings 'redefine';
};
if (defined $proto) {
- *$closure_import_func = eval "sub ($proto) { &\$load_sub }";
+ *$closure_import_func = eval "sub ($proto) { goto &\$load_sub }"
+ || die;
} else {
*$closure_import_func = $load_sub;
}