in reply to Re^3: Comparing hash data
in thread Comparing hash data

Even if you don't know the beginning of the key, this way is completely useless at trying to map values to values even.

It's testing every value against every value, with no references to keys, so how on earth are you going to be able to tell which keys are csv/sql pairs from this?

My quick hack solution assumes you know the keys. Even if you don't, it would be trivial use a regular expression to map them across.

However you do it though, the point is to check the corresponding values of key pairs, not compare one value against all possible values in the other hash.

cLive ;-)

Replies are listed 'Best First'.
Re^5: Comparing hash data
by Grygonos (Chaplain) on Oct 02, 2004 at 02:42 UTC

    You're right.. you won't.. you'll just know that a problem exists. Sorry I would (personally) hate to make an assumption based on the OP's comments and lead them wrong. Your solution does work..assuming everything starts with "EMP"..but my assumption (see!? hehe) was that EMP stood for employer (in my line of work that's a common abbrev... I don't know if that's standard or not)..so I believed that all the fields would not in fact begin with that. It really doesn't matter .. your solution works under that assumption and it is a good solution...however I just want to make sure the OP gives us good info so we can help it understand what we reccomend.. /ramble off