instead of using a hash where keys and values are strings, use a hash where the keys are strings and the values are references to arrays (so you can put more than one value for a key):
my %h;
while( <> ) {
my ($k, $v) = process $_;
push @{$h{$k}}, $v
}
for my $k ( keys %h ) { #traverse all keys
for my $v ( @{$h{$K}} ) { #traverse all values for that key
do_your_stuff $k, $v;
}
}
and read perllol, perlreftut, perlref, perldsc... I would prefer you read them in that order, but do as you please!!!
[]s, HTH, Massa (κς,πμ,πλ)
| [reply] [d/l] |