There are a few problems with that. If the hash values are not numeric your == will cause trouble. Switching that to eq will get you some way, but then values of '079' and '79' don't compare equal although they may be considered so for the applications use of them.
Then you get into more esoteric problems. What if the values of the hash are themselves hashes or arrays (references). Comparing the stringyfied references will say that two arrays are different even if their contents is similar as they will have different addresses. Are two content-similar, but physically different arrays considered equal? That's almost a philisophical debate and very much depends on the application.
That said. Many of these problem exists with most of the other solutions offered also.
In reply to Re: Re: Comparing hashes without sorting the keys
by BrowserUk
in thread Comparing hashes without sorting the keys
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |