in reply to Re: Looking up a hash by value
in thread Looking up a hash by value
Rather than iterating through %whop, you can use reverse to swap the keys and values of a hash, then use exists:
my %whop_value = reverse %whop; foreach my $newm (@newest_members) { $newm .= '<b>*</b>' if exists $whop_value{$newm}; $newm .= ' - '; print $newm; }
Using reverse on hashes is described in perlfunc:reverse
|
|---|