in reply to Populating hash keys

You can find a variety of solutions to dynamic hash population at setting hash keys by array e.g
use Data::Dumper; ## japhy's solution, with a style contribution from Juerd my @keys = qw( this that those ); my $node = \\my %hash; $node = \$$node->{$_} for @keys; $$node = 'value'; print Dumper(\%hash); __output__ $VAR1 = { 'this' => { 'that' => { 'those' => 'value' } } };
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Populating hash keys
by dda (Friar) on Oct 03, 2003 at 13:37 UTC
    Thanks broquaint. How did you manage to find exactly the same question? Please share with me what to enter in Super Search input box -- next time I'll use this technique :).

    --dda

      Since I contributed to the thread I vaguely remembered what was contained within the replies, so I just searched for and of Juerd's threads containing the string 'style' as I roughly remembered what he'd written in his reply to japhy. That's about the only way I usually find anything with Super Search, but that's just me ;)
      HTH

      _________
      broquaint