Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Christopher Solomon
%ignore = map { $_ => 1 } @ignore; @diff = map { $a{$_} ne $b{$_} } grep { !$ignore{$_} } keys %a; @diff will end up with a list of key/value pairs of %a that are different from %b, excluding those of %ignore. note: this is untested. Chris On 7 Feb 2002, Chas Owens wrote: > I have t

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 13:21, Jeff 'japhy' Pinyan wrote: > On Feb 7, Chas Owens said: > > >I have two hashes (%a and %b) that contain data for one person from two > >different systems and I want to compare these hashes to see if the > >systems are out of sync. The catch is I know that some of the

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Chas Owens said: >I have two hashes (%a and %b) that contain data for one person from two >different systems and I want to compare these hashes to see if the >systems are out of sync. The catch is I know that some of the fields >will always be different and I want to ignore those field

ignoring some fields in a comparision of hashes

2002-02-07 Thread Chas Owens
I have two hashes (%a and %b) that contain data for one person from two different systems and I want to compare these hashes to see if the systems are out of sync. The catch is I know that some of the fields will always be different and I want to ignore those fields. Below is my solution, does a