http://qs321.pair.com?node_id=596763


in reply to use of DBI perl function fetchall_arrayref

It sounds like others have already pointed you to some good resources for derefencing, etc., but there are two things which are conspicuous in their absence from your code:

I usually do something like this:

my $ary_ref = $sth->fetchall_arrayref(); if ($DBI::errstr) { print "Error detected: $DBI::errstr\n"; return; } else { if (ref($ary_ref) eq 'ARRAY') { # go on to process the array reference. } else { # do something with Data::Dumper } }

Replies are listed 'Best First'.
Re^2: use of DBI perl function fetchall_arrayref
by Anonymous Monk on Sep 02, 2009 at 12:01 UTC
    The fetchall_arrayref method can be used to fetch all the data to be returned from a prepared and executed statement handle. It returns a reference to an array that contains one reference per row.