Help for this page

Select Code to Download


  1. or download this
    if    (CONDITION)  { ACTION }
    elsif (CONDITION)  { ACTION }
    ...
    elsif (CONDITION)  { ACTION }
    else               { ACTION }
    
  2. or download this
    $_ % 2 or $_ % 3 or $_ % 4 or $_ % 5 or say for $from .. $to;
    
  3. or download this
    $ perl -wE 'foreach my $i ( 0 .. 120 ) { if ($i % 2 != 0) { next; } el
    +sif ($i % 3 != 0) {next; } elsif ($i % 4 != 0) {next; } elsif ($i % 5
    + != 0) {next; } else { say $i;} }'
    0
    60
    120
    
  4. or download this
    $ perl -wE 'foreach my $i ( 0 .. 120 ) { if ($i % 2) { next; } elsif (
    +$i % 3) {next; } elsif ($i % 4) {next; } elsif ($i % 5) {next; } else
    + { say $i;} }'
    0
    60
    120
    
  5. or download this
    $ perl -wE 'foreach my $i ( 0 .. 120 ) { next if $i % 2 or $i % 3 or $
    +i % 4 or $i % 5; say $i; }'
    0
    60
    120
    
  6. or download this
    $ perl -wE 'foreach my $i ( 0 .. 120 ) { say $i unless $i % 2 or $i % 
    +3 or $i % 4 or $i % 5; }'
    0
    60
    120
    
  7. or download this
    $ perl -wE 'for ( 0 .. 120 ) { say unless $_ % 2 or $_ % 3 or $_ % 4 o
    +r $_ % 5; }'
    0
    60
    120
    
  8. or download this
    $ perl -wE 'for ( 0 .. 120 ) { $_ % 2 or $_ % 3 or $_ % 4 or $_ % 5 or
    + say; }'
    0
    60
    120
    
  9. or download this
    $ perl -wE '$_ % 2 or $_ % 3 or $_ % 4 or $_ % 5 or say for 0 .. 120'
    0
    60
    120