in reply to Substituting literal strings for escape characters
You are going in the right direction with the evalled substitution, but consider what you end up with: eval "\n", which is much the same as
eval { }
The obvious next thing to try is adding the quotes:
but that doesn't do the trick, and brainfade prevents me from explaining why. :(s/(\\\w)/"$1"/eg;
Adding a second evaluation step is enough to achieve the desired result:
Hugos/(\\\w)/qq{"$1"}/eeg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Substituting literal strings for escape characters
by xmath (Hermit) on Feb 18, 2003 at 15:54 UTC |