use strict; use warnings; my %big_hoh; while ( my $data = get_one_record(...) ) { my @key_list = get_arbitrary_length_key_list($data, ...); my $last_key = pop @key_list; my $storage_point = \%big_hoh; foreach my $key (@key_list) { if ( ! exists $storage_point->{$key} ) { $storage_point->{$key} = {}; $storage_point = $storage_point->{$key}; } } # Added to kick next line $storage_point->{$last_key} = $data; # out of the cycle }
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re: Hash of Hash of Hash of ...
by polettix
in thread Hash of Hash of Hash of ...
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |