in reply to hash help
Since you stuff everything in hashes, you can use them to look up.
my %result; for my $key (keys %pr1, keys %si1) { my @values; push @values, @{$pr1{$key}} if $pr1{$key}; push @values, @{$si1{$key}} if $si1{$key}; $result{$key} = join ', ', @values; }
The code above is not completely done, but it should get you in the right direction. Please do also consider more clear variable names. Names like $pr1 is an indicator of bad design.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash help
by bkish11 (Novice) on Jun 29, 2009 at 04:21 UTC |