in reply to Re^2: Regex: match a word stem plus an optional suffix from a group
in thread Regex: match a word stem plus an optional suffix from a group

You should also escape interpolated stuff in regexen. \Q${wordstem}\E in this case. If you don’t, you can end up with really confusing bugs and, depending on Perl version, a malicious regex that can be a DoS attack. I would encourage you to use /x to improve readability. Something like–

/ \b \Q${stem}\E (?: s | 's | n )? \b /xi