how to get individual array element from perl -
following output of dumper($resultset);
$var1 = bless( { 'rows' => [ bless( { 'columns' => [ bless( { 'columnname' => 'tableschemaname', 'columnvalue' => 'from_perl' }, 'abc::tcolumn' ) ] }, 'abc::trow' ) ] }, 'abc::tresultset' );
how iterators on columns
arrays.
the data want access encapsulated in object of type abc::tresultset
. class should have api allow access members. bad idea circumvent encapsulation, if quite easily.
if weren't dealing objects nested data stuctures, can retrieve arrayref want, , dereference loop on it:
for $row (@{ $var1->{rows} }) { $cell (@{ $row->{columns} }) { ($name, $value) = @{$cell}{qw/columnname columnvalue/}; # hash slice ...; } }
Comments
Post a Comment