print "Transaction ID\tPROD\tUAT Tran ID\tUAT\n"; # $key = transaction ID # $value = detail data of interest #prod hash is just a hash on transaction id (the reference is to a specific role). UAT hash is a HoH of ## $uat{transaction id}{role} while (my ($key, $value) = each(%$prod)) { print "$key\t$value\t"; exists $uat_tid{$key}?print "$uat_tid{$key}\t":print "No UAT trans id\t"; exists $uat->{$key}{$inrole}?print "$uat->{$key}{$inrole}":for my $role_key ( keys %{$uat->{$key} } ) { print $role_key if $uat->{$key}{$role_key} eq $value}; ## iterate through UAT hash for transaction id to determine if party has been remapped to a different role # Does the code below work? And if so, can I really insert it the way I did into the trinary operator above? # for my $role_key ( keys %{$uat->{$key} } ) # { print $role_key if $uat->{$key}{$role_key} eq $value;} print "\n"; }