You might want to explore using a hash of complex records that are very similar to structures in C/C++. More info at http://perldoc.perl.org/perldsc.html#Declaration-of-a-HASH-OF-COMPLEX-RECORDS alright, thanks!