in reply to Looping trough Array Key/Value Pairs

Hello maikelnight and welcome to the monastery and to the wonderful world of Perl!.. well you are year since 2011 but this is your first post so a bit late welcome..

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*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.