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


in reply to Hash sort again!!

In addition to all the other suggestions, you could also try changing
sort {$a<=>$b} (keys (%sentence_count));
to
my @sortedkeys = sort keys %sentence_count;

sort is smart enough to figure out how to do the comparison for you. Once the array returned by keys is sorted, you need to assign it to another array. Sort won't change the order of the keys directly, but will return a new sorted array.

michael
the blue haired monk