On Fri, 2005-02-25 at 11:22 -0700, David Smith wrote:
> I wrote a perl TCP/IP client program that talks to a server. The server
> sends me ASCII over the scoket, but it appends a NULL byte to every string
> (0x00), which I discovered with file redirection and a hex editor (it was
> invisible in the shell output). How can I prune this byte off of the
> string in Perl? I tried chomp, but it appears to only remove \r and \n. I
> also tried s/\s+$// but \s doesn't appear to match the 0x00 character.

What about this:

        s/\x00$//;

Corey

Attachment: signature.asc
Description: This is a digitally signed message part

.===================================.
| This has been a P.L.U.G. mailing. |
|      Don't Fear the Penguin.      |
|  IRC: #utah at irc.freenode.net   |
`==================================='

Reply via email to