@$arrayRef = (); while (my $row = $sth->fetch()) { push @$arrayRef, [ @$row ]; # Make a copy. }