Explicitly require Role::Tiny in Role::Tiny::With (RT#70446)
[gitmo/Role-Tiny.git] / lib / Sub / Quote.pm
index b3a3782..b5c5cc6 100644 (file)
@@ -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: