Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: matching a variable containing metacharacter treated as character

by choroba (Chancellor)
on Feb 21, 2013 at 16:20 UTC ( #1019975=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019975]
help
Chatterbox?
[LanX]: I'm working with legacy code which was ... ehm .. hacked long before I arrived here ...
[LanX]: ... try to explain to a "senior" that code which is "working" should be altered
[LanX]: hmm looks like the EU needs to prepare for a trade war with former allies ...
[erix]: lets boycott english
[LanX]: the language or the "Anglos" in general? ;-)
[LanX]: Donald Trump's first UK post-election interview

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2017-01-16 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.