Louis Pouzin wrote:
> What's "{$s}++" doing at the end of:
> $h{${$lis{$i}{$j}}[1]}{${$lis{$i}{$j}}[0]}{$s}++;
> {$s} looks like one hash deeper with key $s, sorted at the end of your script.
> But then ++. Watsit ?
> Another Perl trick I've got to learn ?
Well, to me it seams that all of us have to remember Perl's basic knowledge:
TIMTOWToDI.
IMHO Richard's minimally commented script does not do anything else than mine:
A hash $h (of some hash landscape) is populated (by means of $h{.......}{...}++ ) ,
detsit.
The various keys of the original hash $lis are cascadingly sorted, and with all
those sorted various keys that hash is printed
In my script I populated the hash by pushing its keys and values into a list and
afterwards making copying that list to a hash, which's keys are to be sorted.
Aaaah -- -- now I see it, one thing is better in Richard's solution: He can sort any
hash
level, while my script can sort only one.
So go ahead, Louis, rewrite Richards script, give meaningful names to all variables
and choose a bit more elegant way of naming and depicting your pet zoo.
And do not forget to feed, hug and pet all of them. Have fun,
Detlef Lindenthal