in reply to Hash throws out duplicate values
Maybe what you want is an hash of arrays?$s = 123; $s = 456; print "$s\n"; # 456 $a[1] = 123; $a[1] = 456; print "$a[1]\n"; # 456 $h{foo} = 123; $h{foo} = 456; print "$h{foo}\n"; # 456
push @{ $h{$k} }, 123; push @{ $h{$k} }, 456; print "$_\n" for @{ $h{$k} }; # 123, 456
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash throws out duplicate values
by spickles (Scribe) on Oct 12, 2009 at 08:56 UTC | |
by ikegami (Patriarch) on Oct 12, 2009 at 09:17 UTC | |
by Marshall (Canon) on Oct 12, 2009 at 10:20 UTC | |
by spickles (Scribe) on Oct 15, 2009 at 14:53 UTC | |
by Marshall (Canon) on Oct 15, 2009 at 18:30 UTC |