Hmm, maybe it is easier to invert it - escape the variables, then eval:
$string =~ s/(\\.)|([\$\@])/$2 ? "\\$2" : $1/gse; $new = eval qq{qq{$string}};
I can't offhand think of any way to introduce unwanted interpolation that this doesn't cover, but you'd obviously want to think about it more carefully than I if going this route. :)
Hugo
In reply to Re: unescape a user-entered string?
by hv
in thread unescape a user-entered string?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |