use warnings; use strict; use threads 'exit' => 'threads_only'; my $ppid = $$; END { return unless $$ == $ppid; print "this should print once\n" } if (fork) { print "parent\n"; sleep 1; } else { print "child\n"; threads->exit; } print "last line of program\n"; __END__ c:\test>junk2 parent child last line of program this should print once