Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: To use a module...or not.

by Aristotle (Chancellor)
on Jul 28, 2004 at 11:39 UTC ( #378000=note: print w/ replies, xml ) Need Help??


in reply to Re^4: To use a module...or not.
in thread To use a module...or not.

there is no way to associate the keys with the resultant sorted values--which was a requirement for the OP.

I didn't see that. To be honest I thought his requirements were somewhat poorly specified. In any case, you can just swap value-ordering for key-ordering by saying

( keys %hash )[ order_of_sorted keys %hash ]

You then have to fetch the values in an extra step by looking up the keys. That's additional work, but you have the keys available in $outer and $inner for later perusal.

This just goes to show my point: separating the problems well improves maintainability.

Makeshifts last the longest.


Comment on Re^5: To use a module...or not.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2015-07-07 03:49 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 (87 votes), past polls