in reply to hash of hash of hash of hash of hash...
print "\"$topHash{$ryear}{$rmonth}{$rday}{$rhour}{$rminute}\"\n";
As you code stands now, you are literally passing the keys $ryear ("\$ryear"), $rmonth ("\$rmonth"), ... and you have not defined an entry for any of those keys. This is demonstrated in the following script:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash = (1 => {1 => 1}); my $key = '1'; print "$hash{'$key'}{'$key'}\n"; print Dumper(\%hash);
with output
Use of uninitialized value in concatenation (.) or string at junk.pl l +ine 9. $VAR1 = { '1' => { '1' => 1 }, '$key' => {} };
Note how the inappropriate interpolation has resulted in the autovivification of the hash key '$key'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash of hash of hash of hash of hash...
by elofland (Initiate) on Feb 25, 2010 at 22:48 UTC | |
by kennethk (Abbot) on Feb 25, 2010 at 23:03 UTC |