in reply to Retrieving a MySQL query in chunks

Maybe you are looking for the "mysql_use_result" attribute of DBD::mysql.

Set it like this:
my $sth = $dbh->prepare("QUERY", { "mysql_use_result" => 1});

Otherwise the whole result is stored in memory (default "mysql_store_result").

Hope this helps