catching errors from BDI.pm

Поиск
Список
Период
Сортировка
От Jeffrey
Тема catching errors from BDI.pm
Дата
Msg-id B51E537E.375B%seesej@uswest.net
обсуждение
Список pgsql-general
Hi,

I am having trouble catching errors from postgress. I am connecting to the
database via perl and DBI.pm The following will work

($dbh = DBI->connect("$dsn", "", "") ) or (print $DBI::errstr and exit());

But this wont (from deliberately spelled wrong)
($sth=$dbh->prepare("select * form tablename")) || (
    # error
    print "\nError".$dbh->errstr
    # error
    );


Actually it will work from a telnet prompt, but if I run this script in a
cgi, it writes the error to the error log instead of the standard out. It
does not execute the code inside the error comments.

Thank you for your help
Jeff Seese


В списке pgsql-general по дате отправления: