Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
We don't bite newbies here... much
 
PerlMonks  

Re: Comparing hashes without sorting the keys

by diotalevi (Canon)
on Feb 18, 2004 at 14:05 UTC ( [id://330012]=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 Comparing hashes without sorting the keys

That doesn't compare the keys. It compares the number of hash buckets vs hash buckets used values for each hash. You are comparing strings like "1/16" and "24/32" which is only of use when you are debugging hash bucket usage. You can use Storable to serialize your hashes for comparison: Storable::freeze( \%a ) eq Storable::freeze( \%b ).

Replies are listed 'Best First'.
Re: Re: Comparing hashes without sorting the keys
by Discipulus (Canon) on Feb 18, 2004 at 14:09 UTC
    thanks Diotalevi,
    can you explain a little more this number of hash buckets vs hash buckets used values for each hash..

    so there is not a smart way to do this ?

    lor*
      The smart way uses either Storable or the (unknown to me) Data::Compare module someone else recommended. You can find more information about hash buckets by using Super Search.

Log In?
Username:
Password:

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