my %dispatch = map { $_ => eval sprintf 'sub { $_[0] %s $_[1] }', $_ } qw/ < <= == >= > /;
Just to abstract it one more level (and get to use eval() constructively again). :-)
(There's a possibility that I'd do this in real code since I've become such an OAOO-junkie. Am I being a bit extreme here? (I usually needn't bother about speed efficiency.))
ihb
In reply to Re: Re: How to do that with eval ?
by ihb
in thread How to do that with eval ?
by iwanthome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |