If you think of your statement handle as a cursor for fetching, then execute and fetch takes to to the end of the result set. You can therefore
a) re-use the array_ref as suggested above (preferable)
b) re-execute the prepared statement handle which will reset the cursor to the beginning of the result set, though you have no guarantee that the table hasn't changed in the meantime.