in reply to eval on hash
I think it's worth mentioning that %$new_hash and %hash1 are two names for the same thing.$\ = "\n"; foreach (eval "keys \%{ \$new_hash->$key }" ){ print }
Update: I suggest rereading perlreftut and perlref to farmiliarise yourself with the concept of pointing at a structure. Perhaps you'll find a more suitable solution.my @path = qw(key1 key2 key3); my $reference = $new_hash; $reference = $reference->{$_} foreach @path; $\ = "\n"; foreach (keys %$reference){ print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: eval on hash
by merlyn (Sage) on Apr 09, 2003 at 17:36 UTC |