X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FEval-WithLexicals.git;a=blobdiff_plain;f=lib%2FEval%2FWithLexicals.pm;h=ac6a91e377eee6870e1246e5986e0798ff177d73;hp=32b84e8cdb200bb2d6c78364673ed9eb2dd2f390;hb=6aa26d86a67266d3d141bd1d9ed95f3cbbdd1b7c;hpb=b2a2beb4d15e28bcd694542a0a0ecd1719ca3b35 diff --git a/lib/Eval/WithLexicals.pm b/lib/Eval/WithLexicals.pm index 32b84e8..ac6a91e 100644 --- a/lib/Eval/WithLexicals.pm +++ b/lib/Eval/WithLexicals.pm @@ -4,7 +4,7 @@ use Moo; use Moo::Role (); use Sub::Quote; -our $VERSION = '1.003001'; # 1.3.1 +our $VERSION = '1.003005'; # 1.3.5 $VERSION = eval $VERSION; has lexicals => (is => 'rw', default => quote_sub q{ {} }); @@ -131,7 +131,7 @@ sub _eval_do { sub capture_list { my $pad_capture = \&Eval::WithLexicals::Cage::pad_capture; - my @names = grep defined && $_ ne '&', map $_->PV, grep $_->can('PV'), + my @names = grep defined && length > 1, map $_->PV, grep $_->can('PV'), svref_2object($pad_capture)->OUTSIDE->PADLIST->ARRAYelt(0)->ARRAY; $Eval::WithLexicals::current_code .= '+{ '.join(', ', map "'$_' => \\$_", @names).' };'