See. exists and grep for more info.my @array = qw/sarah john/; my %hash = ( sarah => 19, john => 25, emma => 22, ); print "$_: $hash{$_}\n" for grep exists $hash{$_}, @array; __output__ sarah: 19 john: 25
_________
broquaint
In reply to Re: extracting values from hashes
by broquaint
in thread extracting values from hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |