This trick has caused me problems. At one point I had Tie::DBI crashing when it got an error from the POSTGRESQL database saying the the database couldn't insert a row. I don't know why, but I had to work around by doing the SQL myself :(
in reply to Re: How to count rows using DBI & mysql - Performance results
in thread How to count rows using DBI & mysql - Performance results
Also, talking coding style, finding out if you can do something by seeing if it throws an error is probably a worse option than checking for it cleanly in the first place.
I didn't believe in evil until I dated it.