in reply to Re: Re: extracting values from hashes
in thread extracting values from hashes
my @array = qw/sarah john/; my %hash = ( sarah => 19, john => 25, emma => 22, ); ## push() would be superfluous my @data = grep exists $hash{$_}, @array; print "data: @data\n"; __output__ data: sarah john
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: extracting values from hashes
by Anonymous Monk on Mar 18, 2003 at 14:30 UTC | |
by broquaint (Abbot) on Mar 18, 2003 at 14:57 UTC |