While I'm still not sure why you need to know how many rows are being returned, you should look at fetchall_arrayref in DBI (look in the section 'Statement Handle Methods'). This will return your entire recordset into an array of array references (one per record).
In your original post, you mentioned that you are using the number of records returned to format your table when you paint the results. Do you really need the record count beforehand or can you define your rules for making your results look nice and use them dynamically while you work through your record set?
Oren