in reply to Re^2: Odd "rows affected" values using DBI on MySQL
in thread Odd "rows affected" values using DBI on MySQL

'0E0' is zero in scientific notation (ie: 0 * 10^0) but it's special in Perl because in a boolean context it evaluates to True (whereas 0 would obviously be false). This allows you to do something like ...

 $dbh->do($sql) or die "Update failed"

... and it would not call die even if no rows were affected.

In practice though when you're using DBI it's simpler and safer to enable RaiseError and use eval to catch the errors.

Replies are listed 'Best First'.
Re^4: Odd "rows affected" values using DBI on MySQL
by tilly (Archbishop) on Jul 24, 2004 at 21:56 UTC
    "0E0" is one of several ways of achieving that effect. "0.0" also comes to mind. And then there is the venerable hack that keeps "0 but true" from generating a warning in numerical context. (Clearly this hack was written and propagated before anyone noticed that there was no need for it...)