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)
In reply to Re: For loop: Hash
by Happy-the-monk
in thread For loop: Hash
by nickt9999
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |