in reply to Just another DBI question.

If you would like to be able to access specific columns then you might consider using fetchorw_hashref. This gets each row one at a time as fetchrow_array does but allows you to access by name instead of having to remember which column was where.

So,

while (my $row = $sth->fetchrow_hashref) { print "The data in this_col is $row->{'this_col'}\n"; push(@rows,$row) # array of hashrefs or the whole table in a data + structure }

I like this better than the other solutions bec it is clean, easy to read and best of all easy to use and flexible.


I admit it, I am Paco.