http://www.perlmonks.org?node_id=995864


in reply to Re^4: How to create loop in perl dynamically
in thread How to create loop in perl dynamically

I think you're using the wrong data structure for your data; use hashes, not arrays.

Read your data in, split it into fields, then construct nested data structures to hold your data. The Perl Data Structures Cookbook (perldsc) has all of the information you need.

You can then either directly extract the information at the requested level or use Data::Path or Data::DPath.