in reply to error report

Since these messages are normally sent to STDERR, you can achieve this by redirecting STDERR to the text file of your choice. Check out http://perldoc.perl.org/functions/open.html, especially the part about halfway down that starts, "You may also, in the Bourne shell tradition, specify an EXPR beginning with..."

Good luck!