in reply to multiple keys hash with array as a value - loop

You said "but it only give me the first user in the hash" when what you should have said is "it only produces output for user rmdb_dbo". That's because your if condition is only displaying output for that user. Try this to debug:
for my $connection (keys %h) { print "Looking at connection '$connection'\n"; for my $userid (keys %{$h{$connection}}) { print "\tLooking at userid '$userid'\n"; @a_ref = @{$h{$connection}{$userid}}; if(lc($userid) eq "rmdb_dbo") { print @a_ref, if ( $a_ref[1] =~ m/update\s*[table\s*]rmdb_ +dbo./i ); } else { print "Not checking '@a_ref' because user is not 'rmdb_dbo +'\n"; } } }

Cheers - L~R