my @rows = map { chomp; [ split /;/ ] } <>; # now you have an array of arrays (rows of columns) my $column = 1; # which column to check for 0 in? if ( grep { $_->[$column] ne "0" } @rows ) { print "Column $column does NOT consist of all 0's.\n"; } # you could extract the contents of just that column, if you need to: my @column1 = map { $_->[1] } @rows;