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


in reply to Re^3: fetchrow_array
in thread fetchrow_array

Greetings all,
Here is my crack at it.
we know that
$sth->{NAME_lc};
returns the column names selected and lower-cased. with that we then utilized those names as a hash slice from the hash %row with the
@row{ @{$sth->{NAME_lc}}};
part. So up to this point we have a hash %row with keys equal to the lower-cased column names returned from the query. So next we reference the slice for the bind_columns call, which we accomplish by doing an \ on the entire list; the same as saying
$sth->bind_columns(\($var1, $var2, $var3));
which would create references for each var in the list.
Nice way of doing it and probably one I will adopt in the future since I mostly use either fetchrow_hashref or just bind explicit vars.
Does that make sense?

-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo