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),
);