in reply to Re: hash of hashes
in thread hash of hashes
#!/usr/local/bin/perl open (MYFILE, 'test1.txt'); while (<MYFILE>) { chomp; print "$_\n"; @line = split /[\s]+/; for ($i = 1;$i <= $#line;$i++) { $d=$line[0]; print "$d"; # $d[$k++]=$line[$i],1; $hash{$d}{$i}=$line[$i]; print "$hash{$d}{$i}\n"; } for my $key (keys %hash) { my $array = $hash{$key}; print "$_ $key, " ; # print $hash{$key}; # print "$_ $key, "; # foreach $x(keys %hash) # { # print $hash{$x} ; # } } } close (MYFILE);
i am not an expert but i tried like this my logic not correct for handling hash of hashes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: hash of hashes
by AnomalousMonk (Archbishop) on Oct 06, 2013 at 05:39 UTC | |
|
Re^3: hash of hashes
by marinersk (Priest) on Oct 07, 2013 at 07:09 UTC |