carcassonne has asked for the wisdom of the Perl Monks concerning the following question:
This works but Perl warns it's deprecated:
push @Names, %names->{$_}{realname} foreach (keys %names);
This provokes a compile error:
push @Names, %names{$_}{realname} foreach (keys %names);
So: what's the proper use ? - Thanks !
Here's the full context:
my @Names; my %names = ( 'Thunder' => { realname => "Mario", }, 'Storm' => { realname => "Alfredo", }, 'Grail' => { realname => "Giuseppe", }, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non-deprecated way to access multi-level hashes
by ikegami (Patriarch) on Mar 07, 2006 at 15:10 UTC | |
|
Re: Non-deprecated way to access multi-level hashes
by TimToady (Parson) on Mar 07, 2006 at 15:57 UTC | |
|
Re: Non-deprecated way to access multi-level hashes
by jkva (Chaplain) on Mar 07, 2006 at 15:13 UTC | |
|
Re: Non-deprecated way to access multi-level hashes
by markov (Scribe) on Mar 07, 2006 at 15:19 UTC | |
by linux454 (Pilgrim) on Mar 07, 2006 at 21:33 UTC | |
|
Re: Non-deprecated way to access multi-level hashes
by bobf (Monsignor) on Mar 07, 2006 at 15:21 UTC |