X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSub%2FQuote.pm;h=b5c5cc63120ca16711ec8032b7bfca53a353a91d;hb=7568ba55848e41dec5a2a6d04f9abab95dcb5fa3;hp=b3a37820ba728a2b8d9a3bf50b30605a140ff774;hpb=d925a56664c288c6dae32d9825fcc4eaeda08b2a;p=gitmo%2FMoo.git diff --git a/lib/Sub/Quote.pm b/lib/Sub/Quote.pm index b3a3782..b5c5cc6 100644 --- a/lib/Sub/Quote.pm +++ b/lib/Sub/Quote.pm @@ -90,8 +90,11 @@ sub _unquote_all_outstanding { $ENV{SUB_QUOTE_DEBUG} && warn $assembled_code; } $assembled_code .= "\n1;"; - unless (_clean_eval $assembled_code, \@assembled_captures) { - die "Eval went very, very wrong:\n\n${debug_code}\n\n$@"; + { + local $@; + unless (_clean_eval $assembled_code, \@assembled_captures) { + die "Eval went very, very wrong:\n\n${debug_code}\n\n$@"; + } } $ENV{SUB_QUOTE_DEBUG} && warn $debug_code; %QUOTE_OUTSTANDING = (); @@ -151,10 +154,10 @@ Sub::Quote - efficient generation of subroutines via string eval quote_sub 'Silly::doggy', q{ print "woof" }; - my $sound; $$sound = 0; + my $sound = 0; quote_sub 'Silly::dagron', - q{ print ++$$sound % 2 ? 'burninate' : 'roar' }, + q{ print ++$sound % 2 ? 'burninate' : 'roar' }, { '$sound' => \$sound }; And elsewhere: