Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: extact nested values

by McA (Priest)
on Mar 04, 2013 at 18:19 UTC ( #1021690=note: print w/ replies, xml ) Need Help??


in reply to Re^2: extact nested values
in thread extact nested values

Do you know how to iterate over a perl list?

As the dumper output shows: The output of $VAR1->{'press-release'}->[0]->{'PromoModuleOne'}->[0]->{'RightColoumn'}->[0]->{'Tabs'}->[1]->{'Links'} is a list ref.

So the following

my $list_ref = $VAR1->{'press-release'}->[0]->{'PromoModuleOne'}->[0]- +>{'RightColoumn'}->[0]->{'Tabs'}->[1]->{'Links'}; foreach my $elem (@$list_ref) { print "Element by element", Dumper($elem), "\n"; }
iterates over the list and you get every element which is by the way also a nested object. But with my solution shown it should be worth of a little transfer to address the child elements in every $elem. If this is not true then you have to learn some basics.

Best regards
McA


Comment on Re^3: extact nested values
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (19)
As of 2015-07-30 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls