in reply to Capturing Error message in a log file.

You might want to use some "professional" logging facility such as Log::Log4Perl (or one of the numerous others on CPAN. If the script has to terminate on that particular error, just log it and exit.

Hope this helps, -gjb-