A will print at the end of the loop if all of the modulo tests come out true.
B will print every time one of the modulo tests come out true during the loop.
What you want is more like:
print "\nLoop 2"; B: for my $a ( 0 .. 9 ) { for my $b ( 2..4 ) { unless( $a % $b ) { next B; } } print $a; }
In reply to Re: Inverted logic
by SuicideJunkie
in thread Inverted logic
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |