Kristofer Wolff wrote:
>
> hi all,
>
> im looking for a way to transform specialcharecters like \n or \r or \t in
> numbers, like \013 \015 and backward, if there is a easy string to uning or
> do i must replace each thing at its own ?
Your question isn't obvious. Why do you want to do this?
\n and \012 are the same thing - just two different ways to represent a linefeed.
You'll need to be more specific. Do you mean that you really have a literal \
character followed by an 'n' character rather than a single special character
\n (newline) embedded in a string?
Something like this would convert the spec chars into 4-char ascii strings
that represent the chars in octal, but I doubt that's what you want:
s/([\r\t\n])/sprintf "\\%03o", ord $1/eg;
Maybe you should just create a conversion hash and use that to do what you want
using the characters as the keys and whatever you want them to become the values.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles http://www.todbe.com/
/ ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_ http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web