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

Re: Passing a regex from a CGI HTML form UPDATE

by Linicks (Scribe)
on Sep 04, 2016 at 09:54 UTC ( [id://1171133]=note: print w/replies, xml ) Need Help??


in reply to Passing a regex from a CGI HTML form

OK, is this any better?:

if (length ($request{'find'}) > 0 ) { $find=$request{'find'}; $replace=$request{'replace'}; while ($line =~ m{(.*)$find(.*)}){ $line = $1 . $replace . $2; } }

Nick

Replies are listed 'Best First'.
Re^2: Passing a regex from a CGI HTML form UPDATE
by hippo (Bishop) on Sep 04, 2016 at 12:06 UTC

    Yes, that looks a good deal better - assuming you are running in taint mode.

    Now try and break it. :-)

      Yes, running with -T option. All looks good, haven't broken anything yet ;) It is perfect for what I need, as it will only be simple substitutions required anyway (when they happen) just to keep the parser working when at work.

      Thanks everybody for their help and input on this subject, I learnt a lot

      Nick

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-18 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found