in reply to Re^5: Load a file into hash with duplicate keys
in thread Load a file into hash with duplicate keys

I think you meant this:

my ($key, $val) = split /\t/, $line; push @{ $hash2{$key} }, $val;

In this case, it only stores the first value.

$VAR1 = { '211560_s_at' => [ 'P' ], '204332_s_at' => [ 'P' ], '216064_s_at' => [ 'P' ], '200005_at' => [ 'P' ], '211110_s_at' => [ 'P' ], '200003_s_at' => [ 'P' ] };

Replies are listed 'Best First'.
Re^7: Load a file into hash with duplicate keys
by Anonymous Monk on Nov 02, 2010 at 21:14 UTC
    ok, then try:

    my ($key, $val) = split /\t/, $line, 2;
      Thank you, this works just fine.