while (<>) { if ($_ =~ /\^E/gi || $_ =~ /gmake.*/gi) { push (@errors, $_) } } #### while (<>) { if (/\^E|gmake/i) { push(@errors, $_); } } #### while (<>) { if (/^(?:\^E|gmake)\s*:/) { push(@errors, $_); } }