in reply to pattern searching and grouping by paragraph

Why do you chomp($line) only to add the linefeed again when printing?

It looks that you could simplify your code to

open (ERRFILE, ">error.log"); open (LOGFILE "/tmp/app.log"); while (<LOGFILE>) { print ERRFILE $line if /xception/; }
All you have to do then is print some linefeeds when you start a new exception.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law