/\Q$variable\E/;
See also the 'perlre' manual page.
Abigail
In reply to Re: Metacharacters in a variable as literals in regex
by Abigail-II
in thread Metacharacters in a variable as literals in regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |