assuming $; doesn't appear in any of your values.my %merge; for my $key ( keys %myhash ) { push $merge{join $;, sort @{$myhash{$key}}}, $key; }
Update: Use the corrected code below. Thanks, Adam. I'll leave the @{} out above for continuity.
- tyeIn reply to Re: How to compare hash value (sort, join, hash)
by tye
in thread How to compare hash value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |