while (){ # the /^ indicates the begining of the research for $_ ($_ is understated here) my @Elements = split(/;/,$_); if ($Elements[1] ne '""'){ print OUTFILE $_; } }