ewhitt has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to loop through the keys, but everything under "prefix" is unique every execution.$VAR1 = 'summary'; $VAR2 = { 'allotments' => 679 }; $VAR3 = 'prefix'; $VAR4 = { '32 ' => 425, '45 ' => 5, '41 ' => 2, '46 ' => 5, '44 ' => 1, '47 ' => 9, '43 ' => 1, '27 ' => 1, '48 ' => 212, '22 ' => 14, '29 ' => 2, '40 ' => 2 };
How can I "wildcard" everything under "prefix" to print the key values?for (@{$hash->{'prefix'}}) { print "$_\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help looping through hash
by Fletch (Bishop) on Aug 29, 2008 at 23:46 UTC | |
by ewhitt (Scribe) on Aug 30, 2008 at 06:36 UTC | |
by ewhitt (Scribe) on Aug 30, 2008 at 07:00 UTC | |
by wfsp (Abbot) on Aug 30, 2008 at 07:29 UTC | |
by FunkyMonk (Bishop) on Aug 30, 2008 at 22:14 UTC | |
|
Re: Need help looping through hash
by toolic (Bishop) on Aug 30, 2008 at 00:24 UTC | |
by ewhitt (Scribe) on Aug 30, 2008 at 01:13 UTC | |
|
Re: Need help looping through hash
by cosmicperl (Chaplain) on Aug 31, 2008 at 00:43 UTC | |
by ewhitt (Scribe) on Aug 31, 2008 at 08:54 UTC |