in reply to perl 5.8 killed my socket!

I believe your problem may be the same as mentioned in this message.

The essential problem is that the reaper seems to interrupt the accept loop in perl 5.8, which didn't happen in 5.6.1.

Here is how I handled it in one of my scripts:

REDO: while (my $ns = $server->accept) { # Normal accept loop here. } print "Got an interruption: $!\n"; goto REDO;

Replies are listed 'Best First'.
Re^2: perl 5.8 killed my socket!
by particle (Vicar) on Dec 11, 2002 at 01:17 UTC

    goto LABEL is generally frowned upon. instead, try:

    ## bare block with redo to catch perl 5.008 accept loop interrupts ## (see http://archive.develooper.com/macosx@perl.org/msg03022.html fo +r details) { while ( my $ns = $server->accept() ) { # Normal accept loop here. } print "Got an interruption: $!\n"; redo; }

    ~Particle *accelerates*

      Problem solved! Thanks guys:)
      while(1) { while ( my $ns = $server->accept() ) { # Normal accept loop here. } print "Got an interruption: $!\n"; }

      Makeshifts last the longest.