in reply to comparing key-value pairs of two hashes
As a side note, if you don't already know it, grep is your friend. For example, assuming you do not really want to store the differing keys as "$_ ", then this should be equivalent to your code:
And in case you do want to store them that way, then you can chain with a map.@diff=grep { !exists $old_gp{$_} } keys %new_gp;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparing key-value pairs of two hashes
by Anonymous Monk on Jul 22, 2005 at 10:58 UTC |