my %table = ( optimal => 'good', failed => [qw(missing bad)], ); print (grep {$_ eq 'missing'} @{$table{failed}}) ? 'missing' : 'ok';