Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Executing CGI/web form directives in regex substitution without pages of code

by Polyglot (Chaplain)
on Feb 19, 2020 at 22:44 UTC ( [id://11113195]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Executing CGI/web form directives in regex substitution without pages of code
in thread Executing CGI/web form directives in regex substitution without pages of code

That's a great question, and until you asked it, I hadn't even caught that. (I had just copy/pasted the error straight from the log, and noticed it was focused on that regex section.)

The code did not contain a double backslash. I copied that line exactly as you had posted it, and it was and still is as follows in the code:

foreach my $line (@data) { push @changed, $line =~ s{$s$c$b\K$m(?=$b$c$e)}{$regexR}r; }

I haven't used the //r before. That is new to me. What does it do? I wondered if it might be the syntax error.

Blessings,

~Polyglot~

  • Comment on Re^4: Executing CGI/web form directives in regex substitution without pages of code
  • Download Code

Replies are listed 'Best First'.
Re^5: Executing CGI/web form directives in regex substitution without pages of code
by jo37 (Deacon) on Feb 19, 2020 at 22:52 UTC

    It means:

    Return substitution and leave the original string untouched.

    Maybe it is not available in your version. But you may work around this.

    -jo

Re^5: Executing CGI/web form directives in regex substitution without pages of code
by AnomalousMonk (Archbishop) on Feb 20, 2020 at 03:09 UTC

    The  /r modifier for  s/// substitution was added with Perl version 5.14 (see Regexp Quote-Like Operators in perlop). What version of Perl are you using?


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-19 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found