Help for this page

Select Code to Download


  1. or download this
    my %hash;
    foreach my $row ( @array ) {
            my $k = defined($row->[1]) ? $row->[1] : 0;
            push @{ $hash{$k} }, $row->[0];
    }
    
  2. or download this
    my %hash;
    push @{ hash{ defined($_->[1]) ? $_->[1] : 0 } }, $_->[0] for @array;