Hi All,
is there any possibility to not die while doing an execute and hold the
error message?
Example1:
$db1=DBI->connect("dbi:Pg:dbname=$cfg{dbname};host=$cfg{dbhost};port=$cfg{dbport}",$cfg{dbuser},$cfg{dbpassword},{PrintError=>0,AutoCommit=>
1}) or adminmail($DBI::errstr),exec ("$workdir/msmonbackup.pl");
When I do this and the connect fails the error is passed to the
adminmail-function and everything is fine.
Example2:
adminmail($DBI::errstr),exec ("$workdir/msmonbackup.pl") if
(!$st2->execute);
Nothing is passed to the adminmail-function !
Example3:
$st1->execute or $err=$DBI::errstr;
adminmail($err),exec ("$workdir/msmonbackup.pl") if ($err);
$err is defined but empty
If I do a die $DBI::errstr, error message is being printed.
Confused !
Best regards,
Stephan
- Re: DBD:Pg Stephan Harren
- Re: DBD:Pg David Wheeler
- Re: DBD:Pg Stephan Harren