From: Graham Knop Date: Tue, 26 Sep 2017 12:44:00 +0000 (+0200) Subject: filter out any fake lexical X-Git-Tag: v1.003006~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FEval-WithLexicals.git;a=commitdiff_plain;h=6aa26d86a67266d3d141bd1d9ed95f3cbbdd1b7c filter out any fake lexical --- diff --git a/lib/Eval/WithLexicals.pm b/lib/Eval/WithLexicals.pm index b3a15e9..ac6a91e 100644 --- a/lib/Eval/WithLexicals.pm +++ b/lib/Eval/WithLexicals.pm @@ -131,7 +131,7 @@ sub _eval_do { sub capture_list { my $pad_capture = \&Eval::WithLexicals::Cage::pad_capture; - my @names = grep defined && length && $_ 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).' };'