I have what I thought was a simple problem, but I've been playing with it for a good while now and can't see my way through it - I'm hoping that someone here will have some suggestions.
I'm trying to convert literal strings, for example '\n', into their respective escape characters, such that the resulting character is interpreted as a newline.
I've tried (among many other things) evaling the literal, using sprintf on the literal and attempting to substitute the literal for an evaluated character (s/(\\\w)/$1/e), but none of these seem to do the trick - I either end up with the string I had before, or an undefined variable.
Does anyone know of a way to convert like this? Any suggestions would be appreciated.
Thanks,
-- Foxcub
A friend is someone who can see straight through you, yet still enjoy the view. (Anon)
In reply to Substituting literal strings for escape characters by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |