in reply to match a word then exit
while( <> ) { exit 1 if /error.*error/ } open ARGV or die; while( <> ) { ... ## do your stuff } [download]