The fetch-while DBI part of the question was discussed a few days ago: bind_columns OR fetchall_arrayref.
In reply to Re: Efficiency on Code by erix in thread Efficiency on Code by Anonymous Monk