in reply to Re: What A Wonderful World: Bitmasks!
in thread What A Wonderful World: Bitmasks!
where you would otherwise just write quux($foo > 0, $bar != 1, $baz > $foo); Ok, it might work (I didn't test, might need an extra dozen parens) to say something like quux( ($foo > 0 && FOO) | ($bar != 1 && BAR) | ($baz > $foo && BAZ) ); but I don't think I need to comment on that.my $param = 0; $param |= FOO if $foo > 0; $param |= BAR if $bar != 1; $param |= BAZ if $baz > $foo; quux($param);
Makeshifts last the longest.
|
---|