in reply to Bus Error from threading IO::Socket
A detached thread must return, and I'm guessing on your platform, the socket isn't closing itself automatically. Maybe try something like this:
sub do_stuff { my $sock = shift; print "Client connected\n"; while( my $input = <$sock> ) { chomp( $input ); print "$input\n"; } print "Client disconnected\n"; $sock->close; #or close($sock); return; }
|
|---|