F
fatted
The DBI module has a function fetchall_arrayref which returns a
reference to an array of references to arrays. Its quite easy to refer
to a row of the matrix:
$row_ref = $array_ref->[0];
(which would correspond to 1 row retrieved from database table), but I
can't think of how to refer to a column of the matrix (corresponds to
all the various values for a particular field / column).
Is it possible to refer to a column using array referencing of some
description? (I know how to iterate over the array and suck out each
column value, I'm just wondering whether there is as easy a way as
when referring to rows). I'd normally iterate using a
foreach/while/for loop or maybe a map function, can anyone think of
alternatives (some sort of array slice or something?).
Cheers,
reference to an array of references to arrays. Its quite easy to refer
to a row of the matrix:
$row_ref = $array_ref->[0];
(which would correspond to 1 row retrieved from database table), but I
can't think of how to refer to a column of the matrix (corresponds to
all the various values for a particular field / column).
Is it possible to refer to a column using array referencing of some
description? (I know how to iterate over the array and suck out each
column value, I'm just wondering whether there is as easy a way as
when referring to rows). I'd normally iterate using a
foreach/while/for loop or maybe a map function, can anyone think of
alternatives (some sort of array slice or something?).
Cheers,