in reply to Creating Multidimensional Hashed Arrays?
Running your code through PerlTidy may help:
my %myarray = ( vlans => { [ { number => "112", name => "JP-WIRELESS", description => "JP-WIRELESS", ip => "192.168.207.1", mask => "255.255.255.0" }, { number => "2113", name => "JP-IDF1-DATA", description => "JP-IDF1-DATA", ip => "10.136.113.1", mask => "255.255.255.0" } ] } );
Notice that PerlTidy is confused about the nested hash (it has aligned the {} for it with the [] for the nested array). That's a strong clue, especially when combined with the 'Odd number of elements in anonymous hash ...' warning you get when using strictures, that something isn't cosher with the nested hash.
Maybe you don't want the nested hash at all? Or maybe you are missing the keys for it and don't want the nested array?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating Multidimensional Hashed Arrays?
by spickles (Scribe) on Aug 28, 2009 at 01:51 UTC | |
by GrandFather (Saint) on Aug 28, 2009 at 02:02 UTC | |
by toolic (Bishop) on Aug 28, 2009 at 02:23 UTC | |
by spickles (Scribe) on Aug 28, 2009 at 02:48 UTC | |
by Anonymous Monk on Aug 28, 2009 at 03:25 UTC | |
by spickles (Scribe) on Aug 28, 2009 at 19:41 UTC |