in reply to How to traverse a two dimentional array in a constructor?
The result of Dumper
It appears in other parts of your code you populate INTERFACE/ROUTINGTABLE in two dimensions correctly, so same deal to access it, perl way
my $ref = [ [ 1..3], [9..11] ]; for my $first ( @$ref ){ for my $item ( @$first ){ print $item; } } __END__ 12391011
The perl way :)
my $ref = [ [ 1..3], [9..11] ]; for my $xi ( 0 .. $#{ $ref } ){ for my $yi( 0 .. $#{ $ref->[ $xi] } ){ print $ref->[ $xi ][ $yi ]; } } __END__ 12391011
See also references quick reference, Data::Diver, Re: Parsing SOAP::Lite results (with Data::Diver)
Great, an update , just mark it How do I change/delete my post?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to traverse a two dimentional array in a constructor?
by Hossein (Acolyte) on Jun 25, 2013 at 10:43 UTC | |
by Anonymous Monk on Jun 25, 2013 at 10:56 UTC | |
by Hossein (Acolyte) on Jun 25, 2013 at 12:28 UTC |