How to remove `` \x{d} metacharacters from strings ...

C

C. Colin Backslas

Howdy,

I've got a Perl-Tk/Net::Telnet command generator [Tl1] to build commands
and send them to a box and display the responses back to a
Tk::Text entry. In each of the response strings I have ``\x{d}''
at the beginning or end of each string.

How can I remove these characters?
Any help would be greatly appreciated.

-- C:\

PS: I have a curses-based command generator which displays the responses
in a Gnome-Terminal window without these characters present.
 
A

Anno Siegel

C. Colin Backslas said:
Howdy,

I've got a Perl-Tk/Net::Telnet command generator [Tl1] to build commands
and send them to a box and display the responses back to a
Tk::Text entry. In each of the response strings I have ``\x{d}''
at the beginning or end of each string.

How can I remove these characters?
Any help would be greatly appreciated.

Do you mean, the five characters \x{d} appear literally in the strings?
If so, that is most likely a bug in the program that generates them.

In a double-quotish context, "\x{d}" expands to ASCII character 13
(d in hex), which is a carriage return (CR). For some reason, the
expansion doesn't seem to happen.

How to get rid of them? Short term: s/\\x{d}//g. Long term: Mail
the author.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top