use threads; sub start_thread { print "Thread started\n"; } my $thread = threads->new("start_thread","argument"); $thread->new(sub { print "I am a thread"},"argument"); $thread->join(); $thread->detach(); my $thread = threads->self(); $thread->tid();