Help for this page

Select Code to Download


  1. or download this
    my $t = 0;
    grep { $t^=1 } LIST
    
  2. or download this
    my $t = 0; #even elements
    #my $t= 1; #odd elements
    grep { $t++ % 2 } LIST
    
  3. or download this
    my $t = 0;
    map { $t++ %2 ? $_ : () } LIST