in reply to Plz help me to create a perl script to catch errors and exceptions

See perlintro, perlopentut, perlretut or better yet, get a good book on perl programming, also see how (not) to ask a question

You'd want something like:

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