Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: sort while push in hash

by gjb (Vicar)
on Apr 07, 2004 at 14:24 UTC ( #343287=note: print w/ replies, xml ) Need Help??


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-


Comment on Re: sort while push in hash

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://343287]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-04 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls