in reply to regex for a socket stream

I wouldn't waste time trying to send stuff over the tcp connection, then try to break it up with a regex. It is better to send it as a hash, then all you need to do is keep track of keys.

I would use Net::EasyTCP and send the data as hash elements. You can send a hash as easy as $client->send(\%hash) , then just read the hash at the other end. I would base64 encode the binary data, and decode it at the other end.

I just post something you could look at Tk encrypted echoing-chat client and server

If you don't want to use Net::EasyTCP, you can serialize the hash yourself, with Storable, and send it.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: regex for a socket stream
by johnnywang (Priest) on Jul 16, 2004 at 19:43 UTC
    Thanks, zentara. The problem for me is that I do not have control over the client, so have to work with what it sends me.