From: Sven Schöling Date: Fri, 13 Jan 2012 10:08:54 +0000 (+0100) Subject: ParseFilter: $_ kann man nicht in einer Closure verwenden. X-Git-Tag: release-3.0.0beta1~343^2^2~11 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1f91b09977b230250042d5c0c3dae72fac4bac44;p=kivitendo-erp.git ParseFilter: $_ kann man nicht in einer Closure verwenden. --- 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), );