the test does not work properly!
use strict; use warnings; use Test::More tests => 2; my $bool; sub odd { return $_[0] % 2; } $bool = (odd(3) && !odd(4)) || (!odd(3) && !odd(1)); ok ($bool, "First call is true"); $bool = (odd(3) && !odd(5)) || (!odd(3) && !odd(1)); ok (!$bool, "Second call is false");
"It doesn't work" is as useful to a developer as "I'm ill" is to a medic. Try to be specific. SSCCE is best.
In reply to Re^5: Evaluate arbitrary boolean expressions
by hippo
in thread Evaluate arbitrary boolean expressions
by gauss76
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |