Is it better if I do this:
foreach my $item ( @array ) { if ( $bool ) { .. code .. } else { .. code .. } }
or
<
If you're optimizing for speed, the second (foreach loops inside the if branches) should be faster, since you won't be doing the test in each loop iteration.