This is not a Perl solution, however it may be a better solution for your situation. Have you thought about caching the recordset not in memory but in the DB itself using a temp table? This would allow you to share the recordset, reduce network traffic, as well as offload some of the logic to the DB.