in reply to Re: Control Structures
in thread Control Structures
Second, as one odd way to solve your problem, you could execute one of a few code blocks:
OK, maybe not much better, but at least you don't compute it more than once.( sub { print "A is less than B" }, sub { print "A is equal to B" }, sub { print "A is greater than B"} )[($a <=> $b) + 1)]->();
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|