in reply to References and passing data to a different sub.

Make the last line of

sub query_databases { .... return \%dbs; }

Call it so:

my $dbsref = query_databases ();

Then pass that to do_compare()

my $result = do_compare( $dbsref );

Within do_compare() us the passed hashref

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

Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!