Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Capturing warnings from DBD:PG

by Happy-the-monk (Canon)
on Nov 15, 2015 at 10:11 UTC ( [id://1147721]=note: print w/replies, xml ) Need Help??


in reply to Capturing warnings from DBD:PG

My question is how do I trap the warning

Warnings go to STDERR, a file handle that is already open.
You can redirect them somewhere, as in below example to a file:

close(STDERR) or die qq(This should not go wrong, but this happened: $!\n); my $warnings = qq(pid.$$.err_warn); # file to contain warnings & error + messages open(STDERR, ">", $warnings) or die qq(unable to open "$warnings" for writing because of: $!\n);

Cheers, Sören

Créateur des bugs mobiles - let loose once, run everywhere.
(hooked on the Perl Programming language)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147721]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-28 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found