exists $uat_tid{$key}?print "$uat_tid{$key}\t":print "No UAT trans id\t"; #### print exists $uat_tid{$key} ? $uat_tid{$key} : '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}; #### if (exists $uat->{$key}{$inrole}) { print $uat->{$key}{$inrole}; } else { for my $role_key (keys %{$uat->{$key}}) { print $role_key if $uat->{$key}{$role_key} eq $value; } }