in reply to matching whole words only

The easiest solution is to use word boundaries:
if (@events = grep /\b$event\b/, @{ $region_of_state{$region_of_state} +}) {
Given your approach, you might also want to add quotemeta support:
if (@events = grep /\b\Q$event\E\b/, @{ $region_of_state{$region_of_st +ate}}) {

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: matching whole words only
by dirtdog (Monk) on Feb 27, 2015 at 16:02 UTC

    bounderies worked like a charm. Thank you!