ocs has asked for the wisdom of the Perl Monks concerning the following question:
Hi.
I have a hash going like this:
Is there a possibility to force the sort function to do so? :)
Thanx for any help!
I want to sort this thing after string1. I tried this one:$hash = { 1 => { key1 => string1, key2 => string2 }, 2 => { key1 => string3, key2 => string4 } }
I doesn't work :(foreach my $key (sort { $hash->{'key1'} {$a} cmp $hash->{'key1'} {$b} +} keys %$hash) { ... }
Is there a possibility to force the sort function to do so? :)
Thanx for any help!
Back to
Seekers of Perl Wisdom