while ((my $row = $sth->fetchrow_hashref) && (@results < 100)) { push @results, $row } warn ("Wasn't able to get 100 records") if (@results < 100)