in reply to Substituting literal strings for escape characters

My first shot at the commandline might provide a start for you:

perl -e "\$test='a\n\nb'; \$test =~ s/(\\\\\\w)/pack(\"h\",\"\$1\")/ge +;print \$test"
yields
a b
Notice that there is a blank in front of the b
I don't know where the blank originates from, but to use pack seems to be starting point

hth

Update:pure luck that it kind of worked with \n, basically b***sh*t.

Update II:I was asked to beep 'the word' out, so that corporate filters don't choke on this node. I'm in no way expecting anybody in here to be offended by it :-)

regards,
tomte