in reply to How to better represent a complex data structure.

Fortunately, you do not have to make all the declarations. You can use anonymous arrays (and hashes):
my %main_file = ( USER => [ [], [], [] ], TEST => [ [], [], [] ], TRIM => [ [], [], [] ], );
If all the arrays are empty at the beginning, you do not have to declare anything - everything will be autovivified when dereferenced. So, in short:
my %main_file; push @{ $main_file{USER}[0] }, $string;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: How to better represent a complex data structure.
by Amblikai (Scribe) on Jan 08, 2013 at 17:13 UTC

    Thanks! I was hoping that would be the case

    I'm still reading about autovivication and i was a little confused by it!