Like this?
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
In reply to Re: How to skip END blocks with threads?
by BrowserUk
in thread How to skip END blocks with threads?
by repellent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |