in reply to Referring to an array without copying to a separate variable first
Note that @{$res->{objects}} and @$res->{objects} are not the same.#!/usr/bin/perl use strict; use warnings; my $res = { 'objects'=>[ {'a'=>'1', b=>'2'} ] }; for my $elem ( @{$res->{objects}} ) { print $elem->{a}."\n"; print $elem->{b}."\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Referring to an array without copying to a separate variable first
by LanX (Saint) on Jun 26, 2013 at 22:06 UTC | |
by kcott (Archbishop) on Jun 27, 2013 at 09:33 UTC | |
by LanX (Saint) on Jun 27, 2013 at 10:04 UTC | |
by kcott (Archbishop) on Jun 30, 2013 at 05:07 UTC | |
by Anonymous Monk on Jun 27, 2013 at 00:06 UTC | |
by LanX (Saint) on Jun 27, 2013 at 00:14 UTC |
In Section
Seekers of Perl Wisdom