in reply to Regexp variable substitution problem in match
/\b\Q$lastitem[3]\E\b/
will do the trick, just like running quotemeta on the scalar before using it in a regex.