Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

die if the wrapper sub eval fails

  • Loading branch information...
commit b3f8aa9df671a5c6f10b9de1a20c9772c98eada5 1 parent 1a312b0
@nothingmuch authored
Showing with 8 additions and 2 deletions.
  1. +4 −1 lib/Data/Thunk/Code.pm
  2. +4 −1 lib/Data/Thunk/Object.pm
View
5 lib/Data/Thunk/Code.pm
@@ -66,6 +66,9 @@ foreach my $sym (keys %UNIVERSAL::) {
next if $sym eq 'ref::';
next if defined &$sym;
+
+ local $@;
+
*{$sym} = eval "sub {
if ( Scalar::Util::blessed(\$_[0]) ) {
unshift \@_, \$sym;
@@ -73,7 +76,7 @@ foreach my $sym (keys %UNIVERSAL::) {
} else {
shift->SUPER::$sym(\@_);
}
- }";
+ }" || die $@;
}
sub AUTOLOAD {
View
5 lib/Data/Thunk/Object.pm
@@ -42,6 +42,9 @@ foreach my $sym (keys %UNIVERSAL::) {
next if $sym eq 'ref::';
next if defined &$sym;
+
+ local $@;
+
*{$sym} = eval "sub {
my ( \$self, \@args ) = \@_;
@@ -50,7 +53,7 @@ foreach my $sym (keys %UNIVERSAL::) {
} else {
return \$self->SUPER::$sym(\@args);
}
- }";
+ }" || die $@;
warn $@ if $@;
}
Please sign in to comment.
Something went wrong with that request. Please try again.