for my $test (@testlist) { if (defined $tref->{$host}{$test}) { my $status = $tref->{$host}{$test}{status}; my $duration = $tref->{$host}{$test}{dur}; # debugging line if (!$tref->{$host}{$test}{status}) { print "$host=>$test\n";} # Some more processing here which is not relevent } else { print "\t
##
'vnsgnnwwor-gw-1' => {
'conn' => {
'dur' => '2.09 hours',
'status' => 'red'
},
'mrtg' => {
'dur' => '4.00 hours',
'status' => 'green'
}
},
####
#!/usr/bin/perl -l
use strict;
use warnings;
my $tref = {
'vnsgnnwwor-gw-1' => {
'conn' => {
'dur' => '2.09 hours',
'status' => 'red'
},
'mrtg' => {
'dur' => '4.00 hours',
'status' => 'green',
},
},
};
my $host = 'vnsgnnwwor-gw-1';
my $test = 'http';
print "$host is ", defined $tref->{$host} ? "True" : "False";
print "$test is ", defined $tref->{$host}{$test} ? "True" : "False";
print "$test=>status is ", defined $tref->{$host}{$test}{status} ? "True" : "False";
print "$test is ", defined $tref->{$host}{$test} ? "True" : "False";
####
vnsgnnwwor-gw-1 is True
http is False
http=>status is False
http is True