Help for this page

Select Code to Download


  1. or download this
    my %hash2 = ();
    my %unique = ();
    foreach my $test (grep(!$unique{$_}++, values %hash)) {
        $hash2{$test} .= join(",", grep({$hash{$_} eq $test ? hash{$_} : u
    +ndef} keys %hash));
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
                    Rate reverse_hash  unique_grep
    reverse_hash 28466/s           --          -2%
    unique_grep  29104/s           2%           --