From 1f91b09977b230250042d5c0c3dae72fac4bac44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 13 Jan 2012 11:08:54 +0100 Subject: [PATCH] ParseFilter: $_ kann man nicht in einer Closure verwenden. --- SL/Controller/Helper/ParseFilter.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Helper/ParseFilter.pm b/SL/Controller/Helper/ParseFilter.pm index 61b819c88..3bf1b6595 100644 --- a/SL/Controller/Helper/ParseFilter.pm +++ b/SL/Controller/Helper/ParseFilter.pm @@ -22,7 +22,10 @@ my %filters = ( my %methods = ( enable => sub { ;;;; }, map { - $_ => sub { +{ $_ => $_[0] } }, + # since $_ is an alias it can't be used in a closure. even "".$_ or "$_" + # does not work, we need a real copy. + my $_copy = "$_"; + $_ => sub { +{ $_copy => $_[0] } }, } qw(similar match imatch regex regexp like ilike rlike is is_not ne eq lt gt le ge), ); -- 2.20.1