Any suggestions as to condensing/optimizing the following code fragment:
foreach my $i ( $from .. $to ) { if ($i % 2 != 0) { next; } elsif ($i % 3 != 0) {next; } elsif ($i % 4 != 0) {next; } elsif ($i % 5 != 0) {next; } else { say $i;} }
In reply to if ... elsif ... else by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |