Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Hash sort again!!

by coolmichael (Deacon)
on Apr 26, 2001 at 08:52 UTC ( [id://75735]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://75735]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.