Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Replace strings with []

by ainkov (Novice)
on Oct 14, 2013 at 06:41 UTC ( #1058131=note: print w/replies, xml ) Need Help??


in reply to Replace strings with []

I believe another option is to use \Q and \E in your regular expression.
This will "quote (disable) pattern metacharacters till \E":

$str =~ s/\Q$_\E/$random{$_}/g;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058131]
help
Chatterbox?
[Lotus1]: you can't but you can request to have it deleted.
[Lotus1]: you can edit it as long as you were logged in when you submitted it

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2017-01-17 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (156 votes). Check out past polls.