See also the Data Structures Cookbook.
I'm going to have to wrap my head around ...
One way to go about that is to dump (see Data::Dumper; see also Data::Dump) the Perl object reference in stages, and from the inside out (i.e., top level to bottom):
print Dumper $obj->{'items'};
will show that you have a reference to an array. Then
print Dumper $obj->{'items'}->[1];
will show that one element of the array contains a hash reference. Finally,
print Dumper ${ $obj->{'items'}->[1] }{'name'};
will show the value of one key of the referent.
Update: BTW: the expression
${ $obj->{'items'}->[1] }{'name'}
is equivalent to the more concise and IMHO preferable
$obj->{'items'}[1]{'name'}
Give a man a fish: <%-{-{-{-<
In reply to Re^5: JSON and Perl Objects - How to access data?
by AnomalousMonk
in thread JSON and Perl Objects - How to access data?
by harryhalpin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |