in reply to Regexp variable substitution problem in match

To make sure that any regex meta characters in $lastitem[3] are interpreted literally, surround the scalar by \Q...\E:

    /\b\Q$lastitem[3]\E\b/

will do the trick, just like running quotemeta on the scalar before using it in a regex.