diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-29 00:41:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-29 00:41:06 -0400 |
commit | 670eec7d461d12c15aca4057aa0a93eb4ba82872 (patch) | |
tree | 3e0d16d48d36baecd2667008c3cf59012973eb7b | |
parent | e91bde6d2c0b5491d56b4427dfff8c35241fe512 (diff) | |
download | eval-closure-670eec7d461d12c15aca4057aa0a93eb4ba82872.tar.gz eval-closure-670eec7d461d12c15aca4057aa0a93eb4ba82872.zip |
only disallow variables with a leading '&'
we don't care about & in the middle of the variable name
-rw-r--r-- | lib/Eval/Closure.pm | 2 |
1 files changed, 1 insertions, 1 deletions
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); |