# Loop through all the threads my $thr; foreach $thr (threads->list) { # Don't join the main thread or ourselves if ($thr->tid && !threads::equal($thr, threads->self)) { $x=$thr->join; print 'TID ' . $thr->tid() . " returned: $x\n" if($verbose || $debug); } # end if } # end foreach # Exit the script cleanly exit 0;