Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
laziness, impatience, and hubris
 
PerlMonks  

Re: sort while push in hash

by gjb (Vicar)
on Apr 07, 2004 at 10:24 UTC ( [id://343287]=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 sort while push in hash

You might be interested in Tie::Array::Sorted which keeps the array sorted while you add things to it.

However, using autovivication won't work: if the array for a certain key doesn't exist yet, you'll have to create the tied array first (unless there's a clever trick I don't know).

Hope this helps, -gjb-

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://343287]
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.