in reply to Re: Comparing hashes without sorting the keys
in thread Comparing hashes without sorting the keys

That won't work! Try it on these hashes, which your code considers equal, for example:

my %aa=(aa=>'aa', bb=>'bb'); my %bb=(a=>'aaa', b=>'bbb');

-sam

Replies are listed 'Best First'.
Re: Re: Re: Comparing hashes without sorting the keys
by greenFox (Vicar) on Feb 19, 2004 at 04:17 UTC
    ++nicely spotted. Even just "flattening" the hash to an array is suicidal, consider
    my %aa=(aa=>'bb', cc=>'dd'); my %bb=(bb=>'aa', dd=>'cc');
    ...ouch!

    --
    Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: Re: Re: Comparing hashes without sorting the keys
by Popcorn Dave (Abbot) on Feb 19, 2004 at 17:30 UTC
    You're right! Given the OP's data I just hacked out a quick solution, but thanks for pointing out my flaw.

    Good call.

    There is no emoticon for what I'm feeling now.