As the documentation mentions (rows of DBI; look for rows under statement handle methods if that link doesn't work) it's dependent on the underlying database driver to begin with, not to mention what your query actually does. The DBD documentation may mention the behavior, too.
Generally, you can only rely on a row count after a non-SELECT execute (for some specific operations like UPDATE and DELETE), or after fetching all the rows of a SELECT statement.
The cake is a lie.
The cake is a lie.
The cake is a lie.