#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %Ahash = ( 1 => { 'Epoch' => 1234567, 'Node' => "ServerA", 'Event' => "Disk Full", 'other' => "Arb data", }, 2 => { 'Epoch' => 1234570, 'Node' => "ServerB", 'Event' => "Net Down", 'other' => "Arb data", }, 3 => { 'Epoch' => 1234580, 'Node' => "ServerC", 'Event' => "Screen Stolen", 'other' => "Arb data", }, ); my %Bhash = ( 1 => { 'Epoch' => 1234530, 'Node' => "ServerD", 'Event' => "Bit Bucket Missing",}, 2 => { 'Epoch' => 1234567, 'Node' => "ServerA", 'Event' => "Disk Full",}, ); #print Dumper (%Ahash); #print "===================================\n"; #print Dumper (%Bhash); while ( (my $Akey, my $Avalue) = each %Ahash) { while ( (my $Bkey, my $Bvalue) = each %Bhash) { if ( $$Bvalue{'Epoch'} eq $$Avalue{'Epoch'} && $$Bvalue{'Node'} eq $$Avalue{'Node'} && $$Bvalue{'Event'} eq $$Avalue{'Event'} ) { print ">>>>>>>MATCHED\n"; print "Ahash => " . Dumper($Avalue); print "Bhash => " . Dumper($Bvalue); print "MATCHED<<<<<<<<<<<<<<\n"; } else { print "NOT MATCHED\n"; } } }