http://www.perlmonks.org?node_id=182144


in reply to Re: DBI specification change
in thread DBI specification change

The DBI pod on version 1.20, that I've been using says (under fetchrow_hashref):

"Currently, a new hash reference is returned for each row. This will change in the future to return the same hash ref each time, so don't rely on the current behaviour."

I've been interpreting this to mean that it is not safe to use the returned hash directly and have been copying the hash like this:

my @rows; while(my $result = $sth->fetchrow_hashref) { push @rows, {%$result}; }