#! perl -slw use strict; use threads; sub t1{ printf "%3d:t1: %s\n", threads->tid, join '|', grep defined, caller(1); return } sub t2 { t1(); printf "%3d:t2: %s\n", threads->tid, ''; '|', grep defined, caller(1); return } sub t3 { for( 1 .. 100 ) { t2(); printf "%3d:t3: %s\n", threads->tid, join '|', grep defined, caller(1); } return; } my @threads = map{ threads->create( \&t3 ) } 1 .. 100; sleep 3; $_->join for @threads;