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 ( [id://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?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-18 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found