in reply to Need advice on hashes and methods
One way (perhaps a little brute-force) is to step through one of the hashes, and deleting entries from both hashes that match. When the dust settles, you'll have all the people in each hash that are not in the other hash. Try something like this (untested) snippet:
foreach (keys %firsthash) { if (exists($secondhash{$_})) { delete($firsthash{$_}; delete($secondhash{$_}; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need advice on hashes and methods
by tom2112 (Novice) on Aug 15, 2006 at 13:55 UTC | |
by ptum (Priest) on Aug 15, 2006 at 14:01 UTC | |
by tom2112 (Novice) on Aug 15, 2006 at 14:05 UTC |