in reply to Is this too clever? (or, stupid DBI tricks)

I think it would be easier to ask DBI to throw the exceptions with RaiseError => 1 than to dutifuly test the return values and throw $sth->errstr.

Replies are listed 'Best First'.
Re^2: Is this too clever? (or, stupid DBI tricks)
by dsheroh (Monsignor) on Jan 05, 2008 at 18:06 UTC
    A select which returns 0 rows is not an error, so why would it raise an exception or set $sth->errstr?

      That's not the point, that was sufficiently solved by the previous responses. I was not replying to the main point of the root node, but rather commenting on something else in the code. Grinder seems to use  or die $sth->errstr, $/; next to any execute() statements which to me looks unnecessary, something that can be had for "free". Sorry if I did not make myself clear.