Thats not the way execute works in DBI. Check the docs, but to summarise for you now
If an error occurs you get undef back
If it doesn't know the number of rows affected get -1 back
If no rows are affected you will get 0E0 back.
otherwise you get the number of rows affected