for $d (@$values) { for $x (0..$#$d) { splice(@$d, $x, 1) if $d->[$x] eq 'UNKNOWN'; } }