Subject: | Mouse stopped at deep lazy_build methods with $@ |
Following code did not work on Mouse 0.56, that worked on Moose 1.02.
Eval error at _build_hoge affects msg methods behavior.
msg method works well when "hoge" use "default" instead of "lazy_build".
Possibly it is not cause by Mouse.
It happened on
- Perl 5.8.8
- CentOS5.4 x86_64
#!/usr/bin/perl
package Hoge;
use Mouse;
has 'fuga' => (
is => 'rw',
isa => 'Str',
lazy_build => 1,
);
has 'hoge' => (
is => 'rw',
isa => 'Str',
lazy_build => 1,
);
sub build_fuga {
shift->hoge;
}
sub_build_hoge {
eval "use Hoge::Hoge"; ## no critic
"HOGEEEEE\n";
}
sub msg {
shift->fuga;
}
package main;
use strict;
use warnings;
my $hoge = Hoge->new;
print $hoge->msg; # segmentation fault