in reply to Re: Re: reverse quotemeta?
in thread reverse quotemeta?

If you are going to do that, then you need to unescape the backslashes as well! While you can do that via (something close to one of these):

s#(?<!\\)((?:\\\\)*)\\n# '\\'x(length($1)/2) . "\n" #ge; # or s#(?<!\\)(\\*)\1\\n#$1\n#g;
I find that having to escape your backslashes only when they preceed a (desired) newline to be confusing so I'd go with japhy's excellent sugestion or perhaps: s#\\([\\n])# $1 eq "n" ? "\n" : $1 #ge

        - tye (but my friends call me "Tye")