Subject: | an attribute with a clearer results in a croak from Method::Generate::Accessor::generate_method |
Perl 5.22.1
Moo 2.002004
MooX::InsideOut 0.001003
The following code:
package Foo;
use Moo;
use MooX::InsideOut;
has nvalid => (
is => 'lazy',
clearer => 'clear_nvalid',
);
1;
results in
Eval went very, very wrong:
{
my $_QUOTED = ${$_[1]->{"\$_QUOTED"}};
my $_UNQUOTED = ${$_[1]->{"\$_UNQUOTED"}};
package Foo;
no warnings 'closure';
sub clear_nvalid {
($_QUOTED,$_UNQUOTED) if 0;
# BEGIN quote_sub PRELUDE
package Method::Generate::Accessor::_Generated;
BEGIN {
$^H = 1762;
${^WARNING_BITS} = "UUUUUUUUUUUUUUUUU\025";
%^H = (
);
}
# END quote_sub PRELUDE
delete $MooX_InsideOut_FIELDS->{$_[0]}->{"nvalid"}
}
$$_UNQUOTED = \&clear_nvalid;
}
1;
Global symbol "$MooX_InsideOut_FIELDS" requires explicit package name (did you forget to declare "my $MooX_InsideOut_FIELDS"?) at (eval 20) line 17.
at /[...]/site_perl/5.22.1/Method/Generate/Accessor.pm line 202.
Removing the clearer quiets everything down.
Thanks,
Diab