in reply to DBI and fetchall_arrayref

The docs say:
If there are no rows to return, "fetchall_arrayref" returns a reference to an empty array.
So just testing for if (@$result) {...} should tell you if there are results.