From 670eec7d461d12c15aca4057aa0a93eb4ba82872 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 29 May 2016 00:41:06 -0400 Subject: only disallow variables with a leading '&' we don't care about & in the middle of the variable name --- lib/Eval/Closure.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Eval/Closure.pm b/lib/Eval/Closure.pm index 3021d68..f85b8e5 100644 --- a/lib/Eval/Closure.pm +++ b/lib/Eval/Closure.pm @@ -221,7 +221,7 @@ sub _clean_eval_closure { if ($alias) { require Devel::LexAlias; Devel::LexAlias::lexalias($code, $_, $captures->{$_}) - for grep index($_, '&')==-1, @capture_keys; + for grep substr($_, 0, 1) ne '&', @capture_keys; } return ($code, $e); -- cgit v1.2.3-54-g00ecf