From: Father Chrysostomos Date: Mon, 22 Dec 2014 22:40:38 +0000 (-0800) Subject: fix for RT#101086 X-Git-Tag: v1.003002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2a2beb4d15e28bcd694542a0a0ecd1719ca3b35;p=p5sagit%2FEval-WithLexicals.git fix for RT#101086 --- diff --git a/lib/Eval/WithLexicals.pm b/lib/Eval/WithLexicals.pm index 89c491c..32b84e8 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 $_ ne '&', map $_->PV, grep $_->isa('B::PV'), + my @names = grep defined && $_ ne '&', map $_->PV, grep $_->can('PV'), svref_2object($pad_capture)->OUTSIDE->PADLIST->ARRAYelt(0)->ARRAY; $Eval::WithLexicals::current_code .= '+{ '.join(', ', map "'$_' => \\$_", @names).' };'