Linicks has asked for the wisdom of the Perl Monks concerning the following question:
Well, I was a bit of a fool on this one (the brown paper bag question)
What I was not thinking was to pass a substution via a request{} variable like this 's/find/replace/'
Duh! I missed that perl easy expands $vars in the context anyway. All you need do is set a $find and $replace var from the form and do this:
if (length ($request{'find'}) > 0 ) { $line =~ s/$request{'find'}/$request{'replace'}/; }
Nick
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pass CGI HTML form $vars to script - REVISITED
by choroba (Cardinal) on Sep 08, 2016 at 07:39 UTC | |
by Linicks (Scribe) on Sep 08, 2016 at 17:18 UTC | |
|
Re: Pass CGI HTML form $vars to script - REVISITED
by Anonymous Monk on Sep 07, 2016 at 22:07 UTC | |
by Linicks (Scribe) on Sep 08, 2016 at 17:21 UTC |