sub do_compare { my $dbsref = shift; for my $key ( keys %$dbsref ) { if ($dbsref->{$key}{ORACLE1} eq $dbsref->{$key}{ORACLE1}) { # the same } else { # different } } }