Re: PERL DBI documentatio -- how to check for errors

Jochen Wiedmann <[email protected]>
Newsgroups gmane.comp.db.mysql.perl,gmane.comp.db.mysql.documentation
Message-ID <[email protected]>
Nitzan Shaked wrote:

> The documentation for how to check the success of various DBI calls, and in
> particular do(), selectrow_foo() and selectall_foo() is unclear and not
> precise, at least for me. Actually I am not sure, after scrutinizing, how
> exactly to check for errors.

It is quite easy: If it is not for reasons of upwards compatibility, 
there is absolutely *no* excuse for not setting the "RaiseError" flag 
and using exception handlers for catching errors. That works guaranteed 
and always, allows you to ignore the return codes and stuff like that 
and, sooner or later, will make your code drastically simpler and better 
to read. (Unless, of course, you ignore error messages completely, which 
is even more simple to read, but obiusly not better.)

"RaiseError" rules.

Jochen

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.