sub go_command { . . . my $thr = threads->create(\&sub1); if ($thr->is_joinable()) { $thr->join(); } } sub sub1 { print("In the thread\n"); }