> On Fri, 04 Mar 2005 17:36:50 -0700, Peter Bowen <[EMAIL PROTECTED]>
> wrote:
>> I suggested it because this is what pack/unpack was designed to do...
>> extract data from streams. In this case a null terminated string.
>
> Seems to me a trivial usage of pack, and not as clear to follow up
> pr
On Fri, 04 Mar 2005 17:36:50 -0700, Peter Bowen <[EMAIL PROTECTED]> wrote:
> I suggested it because this is what pack/unpack was designed to do...
> extract data from streams. In this case a null terminated string.
Seems to me a trivial usage of pack, and not as clear to follow up
programmers.
I suggested it because this is what pack/unpack was designed to do...
extract data from streams. In this case a null terminated string.
I've seen code where this is done with substrs to try to chop off the
junk at the beginning and lop off the terminator at the end - because
the programmer di
> What you're really looking for is pack/unpack try this...
> unpack("A*",$value) - it's pretty common for c++ stuff to marshall a
> struct together and send it to you, and perl just sees a really long string.
Just to get rid of nulls? or do you have another reason for suggesting pack?
--
Al
David,
What you're really looking for is pack/unpack try this...
unpack("A*",$value) - it's pretty common for c++ stuff to marshall a
struct together and send it to you, and perl just sees a really long string.
-Peter
David Smith wrote:
I wrote a perl TCP/IP client program that talks to a se
On Fri, 25 Feb 2005 11:22:07 -0700 (MST), David Smith
<[EMAIL PROTECTED]> 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
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
Not long ago, David Smith proclaimed...
> 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)
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