SamCG has asked for the wisdom of the Perl Monks concerning the following question:
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 spe +cific 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 par +ty has been remapped to a different role # Does the code below work? And if so, can I really insert it th +e 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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Iterating over second key in HoH defined by reference
by Laurent_R (Canon) on Apr 04, 2014 at 18:03 UTC | |
|
Re: Iterating over second key in HoH defined by reference
by kcott (Archbishop) on Apr 05, 2014 at 00:16 UTC | |
|
Re: Iterating over second key in HoH defined by reference
by GotToBTru (Prior) on Apr 04, 2014 at 16:52 UTC |