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

Re: In-place sort with order assignment

by creamygoodness (Curate)
on Sep 20, 2010 at 14:58 UTC ( [id://860854]=note: print w/replies, xml ) Need Help??


in reply to In-place sort with order assignment

You can use Sort::External for stuff like this.
use Sort::External; my $sortex = Sort::External->new; while ( my ($k, $v) = each %hash) ) { # aliases, so no memory hit $sortex->feed($k); } $sortex->finish; my $counter = 1; while (defined($_ = $sortex->fetch)) { $hash{$_} = $counter++; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2025-11-14 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (70 votes). Check out past polls.

    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.