in reply to Creating Hash of hash of hash dynamically
Then, you need to figure out how to differentiate titles from other fields. It isn't apparent from your post, so I cannot help you there.
Finally, populate the hash. A most simple-minded solution would be to create a case structure:
This works is you have some small upper bound of titles. If not, you will need a loop that walks the @title array (untested):my @titles = ...; if (@titles == 1) { $BIGLIST{$title[0]} = [ @RESTOFFIELDS ]; } elsif (@titles == 2) { $BIGLIST{$title[0]}{$titles[1]} = [ @RESTOFFIELDS ]; } ...etc.
my @titles = ...; my $ref = \%BIGLIST; while (@titles > 1) { my $title = shift @titles; $ref = \($ref->{$title}); } $ref->{$title[0]} = [ @RESTOFFIELDS ];
-Mark
|
|---|