Subject: | Mouse: default => sub { $@ } doesn't work with XS |
$@ is undef when used with XS flavour of Mouse. It works correctly with
PurePerl (Mouse::Tiny)
Use case:
$ perl -le 'package E; use Mouse; has e => (is => "ro", default => sub {
$@ }); package main; eval { die "foo" }; my $e=E->new; print $e->e '
$ perl -le 'package E; use Mouse::Tiny; has e => (is => "ro", default =>
sub { $@ }); package main; eval { die "foo" }; my $e=E->new; print $e->e
'
foo at -e line 1.