in reply to Syntax error sorting hash keys

Ummm, in your code, you loop over a list of keys returned by the keys function. This function doesn't guarantee any specific order of retrieval.

You sorted a list of the keys before the loop, but you didn't use that list in the for loop. Perhaps you meant something like:

for my $key (@keys) {
?

Hope that helped,
-v
"Perl. There is no substitute."

Replies are listed 'Best First'.
Re^2: Syntax error sorting hash keys
by tc1364 (Beadle) on Dec 13, 2004 at 17:39 UTC
    Yes.. you are right. Thank you!