http://qs1969.pair.com?node_id=1081167

SamCG has asked for the wisdom of the Perl Monks concerning the following question:

Essentially, I have a process that puts parties in particular transactional roles and am trying to compare production values to uat values. The data is being improved and re-mapped, and I'm trying to figure out how to quantify this.

At this point, I have a loop over the hashes that will compare values, so it will compare a production transaction for a particular role to the uat transaction for the same role and print it (so I can determine if it's changed, added, or removed). In some cases, however, a party has been remapped to a different role. I'd like to reflect this, so if I find the role defined with a value in production I really want to cycle through all the roles defined for the UAT transaction and check if I see the same value, and then print the value it's moved to.

I'm only trying to do this if the role is undefined in UAT, and honestly I'm not sure this is actually what I will eventually need. Essentially I was asked for "how much data has been changed?" -- for several hundred thousand records, for several fields, in moderately complex transactions. What I have does go partway towards that, but I still think it could be improved.

Anyway, comments appreciated.
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"; }




-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;