CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI:
logging the exception in perl



Aug 3, 2006, 7:50 AM

Post #1 of 2 (4738 views)
logging the exception in perl Can't Post

hi all

I want to write the exception message ( the statement with die "stmt") into a required file.

pls any help will be gr8ly appreciated.


Thaumaturge / Moderator

Aug 4, 2006, 3:47 AM

Post #2 of 2 (4735 views)
Re: [rajjj] logging the exception in perl [In reply to] Can't Post

This really isn't a DBI question. You would have been better off asking it in one of the general forums.

There are really two approaches to take. One is to replace all calls to "die" in your program with calls to your own function (called, perhaps, "log_and_die") which logs the message and then calls die.

The other approach would be to override Perl's default "die" handling by putting a reference to a die handler in $SIG{__DIE__}.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives