Revision 1f91b099
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
SL/Controller/Helper/ParseFilter.pm | ||
---|---|---|
22 | 22 |
my %methods = ( |
23 | 23 |
enable => sub { ;;;; }, |
24 | 24 |
map { |
25 |
$_ => sub { +{ $_ => $_[0] } }, |
|
25 |
# since $_ is an alias it can't be used in a closure. even "".$_ or "$_" |
|
26 |
# does not work, we need a real copy. |
|
27 |
my $_copy = "$_"; |
|
28 |
$_ => sub { +{ $_copy => $_[0] } }, |
|
26 | 29 |
} qw(similar match imatch regex regexp like ilike rlike is is_not ne eq lt gt le ge), |
27 | 30 |
); |
28 | 31 |
|
Auch abrufbar als: Unified diff
ParseFilter: $_ kann man nicht in einer Closure verwenden.