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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



rajjj
Novice

Aug 3, 2006, 7:50 AM

Post #1 of 2 (1644 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.



thanx.


davorg
Thaumaturge / Moderator

Aug 4, 2006, 3:47 AM

Post #2 of 2 (1641 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
http://www.dave.org.uk/
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