Put the conditions in a sub. Then you can test things piece-wise with multiple ifs. Arrange them so that the first if will most likely return a fail. This makes the sub decide early and speeds up the code.
sub some_test {
my ( $a, $b, $p, $s ) = @_;
return 0 if $a ne 'A';
return 0 if $b ne 'C';
...
}
In reply to Re: Conditional Elimination
by shawnhcorey
in thread Conditional Elimination
by dunnyman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |