This wasted a significant amount of my time today:
$SIG{CHLD} = sub { 1 };
my $sock = new IO::Socket::INET (
LocalPort => 2305,
Type => SOCK_STREAM,
Proto => 'tcp',
Reuse => 1,
Listen => 10,
) or die "Could not start server: $!.\n";
while (my $child = $sock->accept) {
next if fork;
exit;
}
print "huh?";
Now, one would think that the while loop should just merrily continue along from child to child, but instead -- apparently because of a problem in IO::Socket itself, resulting from the new safe signals in perl 5.8.0 -- the SIGCHLD is improperly interpreted as a SIGALRM and the while loop ends.
I fixed by adding a label FOO: in front of the while loop, and putting a goto FOO below it. Good enough for me.
Same problem here (Score:2)
Unfortunately I can't find it now. And google with site:use.perl.org doesn't seem to fare any better (perhaps there's a NOINDEX on the journal pages?)
Re:Same problem here (Score:1)
I found it! [perl.org] We aren't going crazy! Or, at least, there's no proof, yet.