Given the following code, how could I effectively test for the existance of (@{$failed{$client}}, $sid) before populating it? I'm not sure how to use 'exist' in the context of a nested data structure.
foreach my $key (sort keys %jobs)
{
my $job = $jobs{$key}->{jobid};
my $status = $jobs{$key}->{status};
my $client = $jobs{$key}->{client};
my $class = $jobs{$key}->{class};
my $files = $jobs{$key}->{files};
if ($status gt 0 && $status ne 150)
{
my ($host, $sid, $type) = split ('_', $class);
if ($type =~ /hot|cold/)
{
push (@{$failed{$client}}, $sid);
}
else
{
push (@{$failed{$client}}, $files);
}
}
}