From: Vincent Pit Date: Thu, 28 Aug 2008 17:33:00 +0000 (+0200) Subject: We don't really need to localize the guard since there's no way it could recurse X-Git-Tag: v0.03~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fsubs-auto.git;a=commitdiff_plain;h=2c42189abfa0a714d32432958b6a63730114059c We don't really need to localize the guard since there's no way it could recurse --- diff --git a/lib/subs/auto.pm b/lib/subs/auto.pm index 20ff6d2..9046588 100644 --- a/lib/subs/auto.pm +++ b/lib/subs/auto.pm @@ -121,7 +121,7 @@ sub _fetch { (undef, my $data, my $func) = @_; return if $data->{guard}; return unless $func !~ /::/ and not exists $core{$func}; - local $data->{guard} = 1; + $data->{guard} = 1; my $hints = (caller 0)[10]; if ($hints and $hints->{subs__auto}) { my $mod = $func . '.pm'; @@ -141,14 +141,16 @@ sub _fetch { } else { _reset($data->{pkg}, $func); } + $data->{guard} = 0; return; } sub _store { (undef, my $data, my $func) = @_; return if $data->{guard}; - local $data->{guard} = 1; + $data->{guard} = 1; _reset($data->{pkg}, $func); + $data->{guard} = 0; return; }