$self->get_attribute_map->{$attribute->name} = $attribute;
# invalidate package flag here
- my $e = do { local $@; eval { $attribute->install_accessors() }; $@ };
+ my $e = do {
+ local $@;
+ local $SIG{__DIE__};
+ eval { $attribute->install_accessors() };
+ $@;
+ };
if ( $e ) {
$self->remove_attribute($attribute->name);
die $e;
$code .= "\$$package_name\:\:AUTHORITY = '" . $authority . "';"
if defined $authority;
- eval $code;
- confess "creation of $package_name failed : $@" if $@;
+ my $e = do {
+ local $@;
+ local $SIG{__DIE__};
+ eval $code;
+ $@;
+ };
+ confess "creation of $package_name failed : $e" if $e;
}
1;