foreach my $row (@$values) { @$row = grep {$_ ne "UNKNOWN"} @$row; }