in reply to Re^2: Need advice on hashes and methods
in thread Need advice on hashes and methods
Yeah, I suppose that would work, too. The code sample I gave you would work (and is a little more efficient for large lists, since you're only iterating through the list of keys once, instead of twice.) Essentially you want to eliminate the intersection of the two hashes, I think -- and either way will work.
Update: As you pointed out below, the first foreach removes elements from the first hash, so the second foreach fails to detect matches. Better stick with the single-pass solution. Thanks for pointing that out! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Need advice on hashes and methods
by tom2112 (Novice) on Aug 15, 2006 at 14:05 UTC |