in reply to hash of hash of hash of hash of hash...

If I am reading this correctly, you are having an issue with string interpolation - see Quote and Quote like Operators. The presence of single quotes in your string is interfering with proper interpretation of your desired output. I think you will get your expected results with

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

    That was it, thanks for the moment of clarity! I got tripped up because when explicitly stated the variables I had to single quote them.

    Thanks for your help, I really appreciate it!
    -Eric

      No, you don't. When a key does not contain any white space or does not start with a sigil, Perl will automatically stringify it. Thus

      print "$topHash{2010}{Feb}{11}{00}{03}\n";

      is syntactically equivalent to

      print "$topHash{'2010'}{'Feb'}{'11'}{'00'}{'03'}\n";.

      See Scalar value constructors in perldata, for example.