From: Alexey Tourbin Date: Thu, 18 Aug 2005 08:13:24 +0000 (+0400) Subject: autouse.pm: remove unneeded eval X-Git-Tag: accepted/trunk/20130322.191538~19961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc6dddacc1f7827aa418855fd57066ca3b6f5230;p=platform%2Fupstream%2Fperl.git autouse.pm: remove unneeded eval 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 Date: Thu, 18 Aug 2005 09:06:20 +0400 Message-ID: <20050818050620.GP19097@solemn.turbinal.org> p4raw-id: //depot/perl@25302 --- diff --git a/lib/autouse.pm b/lib/autouse.pm index 85db01f..67c4e01 100644 --- a/lib/autouse.pm +++ b/lib/autouse.pm @@ -3,7 +3,7 @@ package autouse; #use strict; # debugging only use 5.003_90; # ->can, for my $var -$autouse::VERSION = '1.04'; +$autouse::VERSION = '1.05'; $autouse::DEBUG ||= 0; @@ -50,8 +50,7 @@ sub import { my $load_sub = sub { unless ($INC{$pm}) { - eval {require $pm}; - die if $@; + require $pm; vet_import $module; } no warnings 'redefine'; @@ -63,7 +62,8 @@ sub import { }; 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; }