Help for this page

Select Code to Download


  1. or download this
    for (map{{el1=>$list[2*$_], el2=>$list[2*$_+1]}} 0 .. $#list/2) {
        # do things with $_->{el1} and $_->{el2}
    }
    
  2. or download this
    for (my $i=0 ; $i < @list ; $i+=2) {
        my ($el1, $el2) = @list[$i,$i+1];
        # do things with $el1 and $el2
    }