Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: comparing keys and values in different hashes

by Russ (Deacon)
on Mar 03, 2003 at 18:46 UTC ( #240119=note: print w/replies, xml ) Need Help??


in reply to comparing keys and values in different hashes

This post may be interesting to you, in comparing two hashes.

Synopsis:

my %Diffs = ((map(($_ => [$R{$_}, undef]), grep {not exists $S{$_}} k +eys %R)), (map(($_ => [undef, $S{$_}]), grep {not exists $R{$_}} k +eys %S)), (map(($_ => [$R{$_}, $S{$_}]), grep {exists $S{$_} and $R +{$_} ne $S{$_}} keys %R)));

Russ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://240119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-05-19 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?