in reply to Dynamic operators
You could do it using eval.
--my $a = 10; my $b = 20; my $op = '>='; if (eval "$a $op $b") { print "true\n"; } else { print "false\n"; }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Dynamic operators
by Juerd (Abbot) on Sep 11, 2002 at 13:03 UTC |