So what exactly don't you understand? Disclaimer: NOT TESTED!
$SIG{__DIE__} = sub { print LOG "@_\n"; }; open(LOG,">>$fname") || die $!; $dbi = DBI->connect(...) || die $DBI::ERRSTR; $sth = $dbh->prepare("select * from xxx") || die $DBI::errstr; $sth->execute; ... close(LOG) || warn "file I/O error writing to log: $!"; Or instead of opening a file, you could change the above and eliminate the signal handler ($SIG) and the open() and close() statements, and just capture output from STDOUT to a file: ./file.pl | tee -a err.log ----------------- Ron Reidy Senior DBA Array BioPharma, Inc. -----Original Message----- From: Joel West [mailto:[EMAIL PROTECTED] Sent: Monday, August 23, 2004 10:07 AM To: Reidy, Ron Cc: [EMAIL PROTECTED] Subject: RE: Error logs for DBI Thank you ... And having done so I am still having the problem I was earlier. How do I create an error log for a perl DBI script. On Mon, 23 Aug 2004, Reidy, Ron wrote: > perldoc open > perldoc print > perldoc DBI > > ----------------- > Ron Reidy > Senior DBA > Array BioPharma, Inc. > > > -----Original Message----- > From: Joel West [mailto:[EMAIL PROTECTED] > Sent: Monday, August 23, 2004 9:38 AM > To: [EMAIL PROTECTED] > Subject: Error logs for DBI > > > How do I create log files with just errors? > > > > This electronic message transmission is a PRIVATE communication which contains > information which may be confidential or privileged. The information is intended > to be for the use of the individual or entity named above. If you are not the > intended recipient, please be aware that any disclosure, copying, distribution > or use of the contents of this information is prohibited. Please notify the > sender of the delivery error by replying to this message, or notify us by > telephone (877-633-2436, ext. 0), and then delete it from your system. > > This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.