Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: The Best Hash

by dakkar (Hermit)
on Dec 13, 2002 at 19:44 UTC ( [id://219722]=note: print w/replies, xml ) Need Help??


in reply to The Best Hash

You say you have the same keys and the same values in each hash, right? Meaning that doing:

@keys=keys %hash1; @v1=@hash1{@keys}; @v2=@hash2{@keys}; @v3=@hash3{@keys};
will result in @v1 etc. being each a permutation of the others?

If this is the case, I'd use the minimum number of swaps necessary to permute one hash into the other.

Keep in mind that differences are usually defined between two objects. What do you mean with 'least differing from other hashes'?

-- 
        dakkar - Mobilis in mobile

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-16 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found