in reply to Re^2: select elements in a list
in thread select elements in a list

Contrary to what everyone has been assuming, it's possible that your input file never contains three spaces in the second field -- maybe there's a single tab character in that position, and it just looks like three spaces.

So try it like this (similar to what was suggested in a later reply below):

while (<INFILE>) { my @Elements = split(/;/,$_); if ($Elements[1] =~ /\S/){ # if second arg contains non-whitespac +e print OUTFILE; # ("$_" is implied here) } }