/\b\Q$lastitem[3]\E\b/
will do the trick, just like running quotemeta on the scalar before using it in a regex.
In reply to Re: Regexp variable substitution problem in match
by saintmike
in thread Regexp variable substitution problem in match
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |