http://www.perlmonks.org?node_id=256348


in reply to Re: Hash key ordering question
in thread Hash key ordering question

that will actually sort in string comparison order (the default for sort). for numeric order, you want:
... foreach $key1 (sort {$a <=> $b} keys %hshFoo) { ...