use warnings; use strict; while (<>) { print if /ERROR|EXCEPTION/i; } #### myscript.pl /var/log/*log >errors.log