my $sql = "SELECT o.objectid, FROM object o WHERE o.accountid = " . $accountid . ORDER BY o.objectname LIMIT 20 OFFSET 0"; my $object_info_ref = undef; eval { my $sth=$dbh->prepare($sql); $sth->execute(); $object_info_ref = $sth->fetchall_arrayref(); $sth->finish(); };