This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: Re: Detecting there is no more data left From: Simon Oliver <simon.oliver@umist.ac.uk> Date: Tue, 27 Jun 2000 12:55:20 +0100 Will err be undef if no error occured and I just ran > out of data? According to the docs... "If there are no more rows or if an error occurs, then fetchrow_arrayref returns an undef. You should check $sth->err afterwards (or use the RaiseError attribute) to discover if the undef returned was due to an error. " Try something like this: while ( $array_ref = $sth->fetchrow->arrayref ) { print "$array_ref->[0]\n" } die $DBI::errstr if $DBI::err; ===