in reply to more zero byte madness

A quick question:
Is $socket really an IO::Socket::INET object or is it the result of the accept method?

I did a simple test script:

#!/usr/local/bin/perl -w use strict; use IO::Socket; my $sock = IO::Socket::INET->new( Proto => 'tcp', LocalPort => 8080, Listen => SOMAXCONN, Reuse => 1 ); my $data = 'Silly test string.'; { local $\ = qq(\0); print $sock $data || die "What happened? $!"; }
..and this executes just fine, no warnings, no errors. Did I mention that there's no client on the other end?

If you don't make $socket like this (set your ports and such however):

$inet = IO::Socket::INET->new( Proto => 'tcp', LocalPort => 8080, Listen => SOMAXCONN, Reuse => 1 ); $socket = $inet->accept();
then it's entirely possible that you never talk to your client properly at all. The fact that it exits as though it sees a null byte may simply be a timeout exit.

Just a thought -- I'm no socket guru :)