http://www.perlmonks.org?node_id=674739


in reply to Re: Counting number of rows while working with Oracle
in thread Counting number of rows while working with Oracle

The only way for the client to know how many rows will be returned is to count them as they're being read in. The simplest solution would to read all the rows into memory before starting to process them.

Especially since you say your query will only return at most a single row, using fetchall_arrayref or the even more convenient selectall_arrayref should be no problem.