in reply to Looping trough Array Key/Value Pairs
You already received an optimal answer by haukex and I can just add some hints.
If you frequently deal with complex datastructure I suggest to install Data::Dump and use it instead of the CORE module Data::Dumper. Data::Dump ships with the handy dd method: the output is better understandable and you do no need anymore the print used for the core module.
The use of $_ in your statement foreach $_(@testarray) is redundant: foreach already fill $_ for you. Even better use a named variable in your loops: foreach my $element (@array..
Lastly, when when you cycle a complex datastructure you can profit of the ref function that return ARRAY for named or unnamed (anonymous declared with [] ) arrays, HASH for anonymous and named hashes and can return other useful values.
L*
|
|---|