in reply to Imputation of data

So, you just want to grep lines that don't contain 9?
#! /usr/bin/perl use warnings; use strict; use Data::Dumper; use List::Util qw{ none }; my @rows; while (<DATA>) { my @row = split ' '; push @rows, \@row; } print 'before: ', Dumper(\@rows); @rows = grep { none { '9' eq $_ } @$_ } @rows; print 'after: ', Dumper(\@rows); __DATA__ 2 2 0 1 0 2 2 0 2 1 0 2 1 1 0 0 1 1 1 0 2 2 0 0 0 2 9 0 2 1 0 2 0 1 0 2 2 0 9 0
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,