#!/usr/bin/perl use lib "/ssy/nos/thread_libs/lib/"; use threads; my @threads; for (0 ..3) { my $thr = threads->create( sub { sleep 2; } ); $thr->detach(); push @threads, $thr; } # then later for my $thr ( @threads ) { print 'Thread ', $thr->tid, $thr->is_running() ? ' is running' : ' is not running'; }