in reply to reinterpolation of regexp (and strings?)
but that is cumbersome for the user
Presuming the code will end up in a script,
perl -s -e "$data='abcdef'; $data=~s#$r#qq{$s}#ee; print $data" -- -r= +(abc) -s=$1hello
Note that the caller is able to execute arbitrary code, but that goes in hand in hand with what you asked. You'd need some kind of template system to be safe. (Upd: An anonymous monk has provided some.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reinterpolation of regexp (and strings?)
by dHarry (Abbot) on Jul 23, 2008 at 08:00 UTC | |
by ikegami (Patriarch) on Jul 23, 2008 at 08:15 UTC | |
by dHarry (Abbot) on Jul 23, 2008 at 08:52 UTC | |
by dHarry (Abbot) on Jul 23, 2008 at 09:07 UTC |