in reply to Re: Multidimensional hash help!
in thread Multidimensional hash help!
I do have a further question.
I tried to manually traverse my hash so that I can print the keys separated by newline and tab however because the hash is more than 2 dimensions I am experiencing trouble.
(http://perlmaven.com/multi-dimensional-hashes)
Here is the piece of code that I wrote.
#foreach my $symb (sort keys %go_hash) {
#foreach my $UniID (keys %{ $go_hash{$symb} }) {
#foreach my $TaX (keys %{ $go_hash{$symb}{$UniID} }) {
#print "$symb, $UniID, $go_hash{$symb}{$UniID}{$TaX}\n";
#}
#}
#}
and here is a sample output:
Hey, HSWZH7, HASH(0x7fdeb30dc310)
how, HSX0L1, HASH(0x7fdeb3169768)
are, HSX1I1, HASH(0x7fdeb31784b0)
you, HSX4J3, HASH(0x7fdeb31784b0)
The "prettiest" I have made my output using data::dumper so far is to set the indent to 1 and pair to "\t" as shown below.
$Data::Dumper::Pair = " \t ";
$Data::Dumper::Indent = 1;
Thanks again.