while (<>) { next unless /first check/; next unless /second one/; my @foo = split /delimiter/; next if @foo != 5; # or whatever ... }

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$