sub initplayer { my $hand = shift; $hand->blocking(0); print "INITPLAYER CALLED!\n"; threads->detach; doplayer($hand,$hand,$hand); remove_player($hand); print "THREAD DESTROYED!\n"; $hand->close(); }