$sth->execute($foo, $bar, $rat) or die $sth->errstr, $/; my $sum = ($sth->fetchrow_arrayref || [0])->[0]; $sth->finish;