I want to sort this thing after string1
It's not very clear exactly what you want to do. This will sort the hash by the values associated with 'key1' in each sub-hash.
foreach my $key (sort { $hash->{$a}{key1} cmp $hash->{$b}{key1} } keys + %$hash) { ... }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: sort hash after value from hash in hash
by davorg
in thread sort hash after value from hash in hash
by ocs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |