in reply to Stack table columns with hash of arrays

my %foos; while (<>) { my ($foo, @bars) = split; $foos{$_} = $foo for @bars; } print("$foos{$_}\t$_\n") for sort { $a <=> $b } keys %foos;

Update: Fixed keys @foos.

Replies are listed 'Best First'.
Re^2: Stack table columns with hash of arrays
by robertkraus (Novice) on May 31, 2011 at 08:19 UTC
    Thanks a million! And thanks for the quick update fix, I was already trying to find the cause of the error that occurred by "keys @foos" instead of "keys %foos". I changed the print statement (to flip the columns) to
    print("$foos{$_}\t$_\n")
    Cheers, Robert