Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: For loop: Hash

by Happy-the-monk (Abbot)
on Jul 02, 2013 at 08:58 UTC ( #1041982=note: print w/ replies, xml ) Need Help??


in reply to For loop: Hash

No objection to what hdb said above.
If you have to use the exact data structure you presented above, this might be the way to go:

for my $i ( sort keys %{$router_href} ) { for my $j ( sort keys %{$router_href->{$i}->{bgpPeer}} ) { print "($i:$j) " , $router_href->{$i}{bgpPeer}{$j}{Name} , ":\t" , $router_href->{$i}{bgpPeer}{$j}{prefixList} , "\n" } }

Cheers, Sören

(hooked on the Perl Programming language)


Comment on Re: For loop: Hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-05 21:16 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 (68 votes), past polls