in reply to Re: Re: Anyone use "xor" in conditionals?
in thread Anyone use "xor" in conditionals?
This way the conditions are evaluated less times
Eh? Not so.
At best, the expanded version will result in the same number of evaluations.$ perl -le 'print "T" if (print "foo" xor print "bar")' foo bar $ perl -le 'print "T" if ((print "foo" and not print "bar") or (not pr +int "foo" and print "bar"))' foo bar foo
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Anyone use "xor" in conditionals?
by Excalibor (Pilgrim) on Jul 14, 2003 at 19:08 UTC |