I just can't make sense of it. I don't understand what connection you think that array has to that database. So let me take this step by step.
First of all I would strongly recommend adding some error checks to that. If prepare or execute fail (and either could) then $DBI::errstr should have the actual error message. You'll probably want to see that.
But that detail aside, all that finish does is indicates that the statement handle is really done. (So stuff may be flushed, the database told that you're done, etc.) After that, the statement handle is useless.
The array is a structure in your program. Other than what you explictly see in the code, it has no connection to the statement handle or the database. Finishing the statement handle does not affect what is in the array. The database has no idea what you did with its data.
If you run the same code again, the array will wind up with data from both runs. It is possible to write code that takes data from that array and sends it back to the database. It is not possible to write a query in the database that accesses that data.
If you want to accomplish something that looks like the last step, then you either need to insert that data into a table (several databases have the idea of temporary tables that can be useful for this), or you need to make that select statement into a nested subquery in a larger query.
I've tried to answer every permutation that I can think of what you might have meant by your question. Hopefully along the way I answered your actual question.
Cheers,
Ben