in reply to match a word then exit

open (FILE '<file.txt'); my @file = <FILE>; close FILE; foreach my $line (@file) { exit if $line =~ /error.*error/; # Process here }

<(^.^-<) <(-^.^<) <(-^.^-)> (>^.^-)> (>-^.^)>