while (@row = $sth->fetchrow) { if (@row > 1) { push(@ret,[@row]); } else { push(@ret,@row); } } $sth->finish;