in reply to unescape a user-entered string?

It depends on what keystrokes you mean. If your user is hitting the Tab key, then you only need print whay you get. If they are using backwhack and 't', you will have to translate somehow.

You are wise to want to avoid eval of user input. How about a simple substitution?

$_ = 'Name:\tFrank\nAge:\t32'; s/\\t/\t/g; s/\\n/\n/g; print;

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: unescape a user-entered string?
by zovirl (Initiate) on May 30, 2004 at 18:38 UTC
    Yeah that would work. I was wondering if I was missing a simpler option