Help for this page

Select Code to Download


  1. or download this
    my @e =
       grep !$_,
          map $_ % 2,
             @c;
    
  2. or download this
    my @e =
       map $_ % 2 ? () : 0,
          @c;
    
  3. or download this
    my @e;
    for my $c ( @c ) {
       my $d = $c % 2;
       push @e, $d if !$d;
    }
    
  4. or download this
    my @e;
    for my $c ( @c ) {
       push @e, 0 if !( $c % 2 );
    }
    
  5. or download this
    my @e = ( 0 ) x grep !( $_ % 2 ), @c;
    
  6. or download this
    my @e; push @e, 0 for 1 .. grep !( $_ % 2 ), @c;