CC: | perl5-porters [...] perl.org, bug-Moose [...] rt.cpan.org |
Subject: | [perl #114628] Bleadperl v5.17.3-133-g3da9985 breaks DOY/Moose-2.0603.tar.gz |
Date: | Tue, 28 Aug 2012 00:31:48 -0700 |
To: | "OtherRecipients of perl Ticket #114628":; |
From: | "Father Chrysostomos via RT" <perlbug-followup [...] perl.org> |
On Mon Aug 27 21:49:07 2012, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Show quoted text
> git bisect
> ----------
> commit 3da9985538c5eae2dd2de1309b320bc77f757687
> Author: Father Chrysostomos <sprout@cpan.org>
> Date: Sun Aug 26 11:10:18 2012 -0700
>
> Croak for \local %{\%foo}
OK, I have two patches for Moose.
The first one removes the local, making it behave in bleadperl exactly
the way it behaves in earlier versions (the local was ignored).
The second patch keeps the local, changing things to what was probably
intended. I suspect Moose’s test suite needs improvement to catch the
effective lack of local (or was it just to conserve memory?)
Unfortunately, lexical vars can’t be localised.
Choose wisely.
--
Father Chrysostomos
---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114628
diff -rup Moose-2.0603-qRHQsv-orig/lib/Moose/Exporter.pm Moose-2.0603-qRHQsv/lib/Moose/Exporter.pm
--- Moose-2.0603-qRHQsv-orig/lib/Moose/Exporter.pm 2012-06-28 09:18:50.000000000 -0700
+++ Moose-2.0603-qRHQsv/lib/Moose/Exporter.pm 2012-08-28 00:23:48.000000000 -0700
@@ -140,13 +140,13 @@ sub _make_exporter {
}
{
- my $seen = {};
+ our %_seen;
sub _follow_also {
my $class = shift;
my $exporting_package = shift;
- local %$seen = ( $exporting_package => 1 );
+ local %_seen = ( $exporting_package => 1 );
return uniq( _follow_also_real($exporting_package) );
}
@@ -171,9 +171,9 @@ sub _make_exporter {
for my $package (@also) {
die
"Circular reference in 'also' parameter to Moose::Exporter between $exporting_package and $package"
- if $seen->{$package};
+ if $_seen{$package};
- $seen->{$package} = 1;
+ $_seen{$package} = 1;
}
return map { $_, _follow_also_real($_) } @also;
diff -rup Moose-2.0603-qRHQsv-orig/lib/Moose/Exporter.pm Moose-2.0603-qRHQsv/lib/Moose/Exporter.pm
--- Moose-2.0603-qRHQsv-orig/lib/Moose/Exporter.pm 2012-06-28 09:18:50.000000000 -0700
+++ Moose-2.0603-qRHQsv/lib/Moose/Exporter.pm 2012-08-28 00:17:15.000000000 -0700
@@ -146,7 +146,7 @@ sub _make_exporter {
my $class = shift;
my $exporting_package = shift;
- local %$seen = ( $exporting_package => 1 );
+ %$seen = ( $exporting_package => 1 );
return uniq( _follow_also_real($exporting_package) );
}