Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my @array = ('sarah', 'john'); # stores the keys i'm interested in my %hash = ( 'sarah' => '19', 'john' => '25', 'emma' => '22', ); if (exists ($hash{$array[0]})) { print value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: extracting values from hashes
by merlyn (Sage) on Mar 18, 2003 at 13:49 UTC | |
|
Re: extracting values from hashes
by broquaint (Abbot) on Mar 18, 2003 at 13:55 UTC | |
by Anonymous Monk on Mar 18, 2003 at 14:13 UTC | |
by broquaint (Abbot) on Mar 18, 2003 at 14:22 UTC | |
by Anonymous Monk on Mar 18, 2003 at 14:30 UTC | |
by broquaint (Abbot) on Mar 18, 2003 at 14:57 UTC |