Jeri has asked for the wisdom of the Perl Monks concerning the following question:
I really think the three key structure is best for this task as I have a very complicated structure.foreach my $key1 (sort keys %hash){ foreach my $key2 (sort keys %{$hash{$key1}}){ print "$key1\t$key2\t$hash{$key1}{$key2}\n"; } }
Thanksforeach my $key1 (sort keys %hash){ foreach my $key2 (sort keys %{$hash{$key1}} ){ foreach my $key3 (sort keys %{$hash{$hash{$key1}} } ){ print OFH "$key1\t$key2\t$key3\t$hash{$key1}{$key2}{$key3} +\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash with three keys
by AnomalousMonk (Archbishop) on Dec 12, 2013 at 21:15 UTC | |
by Jeri (Scribe) on Dec 12, 2013 at 21:18 UTC | |
|
Re: Hash with three keys
by hdb (Monsignor) on Dec 12, 2013 at 21:46 UTC | |
|
Re: Hash with three keys
by toolic (Bishop) on Dec 12, 2013 at 21:07 UTC |