http://www.perlmonks.org?node_id=1019975


in reply to matching a variable containing metacharacter treated as character

Use \Q:
grep /\Q$var/, @foos;
See Escape sequences for details.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: matching a variable containing metacharacter treated as character
by docdurdee (Scribe) on Feb 21, 2013 at 16:47 UTC
    Thank you!