http://qs321.pair.com?node_id=276653


in reply to Exists in HASH issue

Hello,

you should read
perldoc perlvar
first, to understand how hashes work. As said before, they are not sorted in any way.
But you can print them out sorted or do something else with them in a sorted way.
This would cause a numerical order:
foreach (sort {$a <=> $b} keys %hash) { # do something with $hash{$_} ... }
To sort them lexically just use:
foreach (sort keys %hash) { # ... }
Read 'perldoc -f sort' for more information.

snadra