From: Yuval Kogman Date: Sat, 16 Aug 2008 02:15:04 +0000 (+0000) Subject: localize %seen instead of resetting it X-Git-Tag: 0_55_01~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8df9ab6482a1b6687a9560242e9e6ce8e0a9fa73;p=gitmo%2FMoose.git localize %seen instead of resetting it --- diff --git a/lib/Moose/Exporter.pm b/lib/Moose/Exporter.pm index 1eb8a51..01ed414 100644 --- a/lib/Moose/Exporter.pm +++ b/lib/Moose/Exporter.pm @@ -56,13 +56,13 @@ sub build_import_methods { } { - my %seen; + my $seen = {}; sub _follow_also { my $class = shift; my $exporting_package = shift; - %seen = ( $exporting_package => 1 ); + local %$seen = ( $exporting_package => 1 ); return uniq( _follow_also_real($exporting_package) ); } @@ -82,9 +82,9 @@ sub build_import_methods { for my $package (@also) { die "Circular reference in also parameter to MooseX::Exporter between $exporting_package and $package" - if $seen{$package}; + if $seen->{$package}; - $seen{$package} = 1; + $seen->{$package} = 1; } return @also, map { _follow_also_real($_) } @also;