use Data::Dumper; my @keys = qw( this that those ); my $node = \\my %hash; # edit: this was my old way... # my $i = 0; # $node = \$$node->{$keys[$i++]} while $i < @keys; # thanks to Juerd $node = \$$node->{$_} for @keys; $$node = "value"; print Dumper \%hash;
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
In reply to Re: setting hash keys by array
by japhy
in thread setting hash keys by array
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |