Hey, I'm just wondering if there is a cool "one liner" that would sort my hash massive links. So I have a bunch of keys / values in my hash, like this:
$DataBase{$key} = \@value;
However, I would like to sort the hash by an element array[0]. Then scroll them. I had this for starters:
foreach my $key (sort {$DataBase{$a} cmp $DataBase{$b} } keys %DataBase)
But this, obviously, just sorts my hash by the value of the array pointer. This does not have to be a “single line”, but I was hoping for a solution that is not related to restoring the hash.
Balk source
share