@sorted_keys = sort { $a <=> $b } keys %hash; #use { $a <=> $b } for numerical sorting #use { $a cmp $b } for string sorting foreach(@sorted_keys) { print $hash{$_}; }
In reply to Re: hash sorting problems
by Beatnik
in thread hash sorting problems
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |