Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: qr// and user provided regex patterns...

by toolic (Bishop)
on Aug 02, 2009 at 13:51 UTC ( #785241=note: print w/replies, xml ) Need Help??

in reply to Re^2: qr// and user provided regex patterns...
in thread qr// and user provided regex patterns...

I suspect that qr was not intended to be used on an entire subsitution operator like that. I believe it should only be used on the regular expression portion (left side) of the subsitution. See perlop.

Here is an example script which uses s/// as a command-line option:

Replies are listed 'Best First'.
Re^4: qr// and user provided regex patterns...
by misterMatt (Novice) on Aug 02, 2009 at 21:00 UTC
    so I pretty much will have to split it and evaluate it like this: eval("$text =~ s/$pa/$tx/$md"); It might be difficult splitting a regex that could contain multiple /'s. I'll have to adjust the program so the user enters the pattern, and replacement separately I guess.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://785241]
[ambrus]: Eily: also webpages aren't displayed on my monitor no matter what I click with the mouse, and there's a blackout right now, could that be a problem?
[robby_dobby]: ambrus: Yes
[hippo]: erix++: "the browser ate my code"
[robby_dobby]: Eily: Now, people are trying to be inventive with crowdsourcing their work, eh? Sure, call on the admins to k-line these sockpuppet accounts!
[robby_dobby]: hippo: I like how you equated your browser to a dog....
[Eily]: well, Anonymonk is everyone's sockpuppet :D

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-04-25 13:13 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (454 votes). Check out past polls.