$line =~ m/ ... /i or next; $line =~ m/ ... /i or die "line '$line' failed to match"; $line =~ m/ ... /i or do { # log it somewhere next; };