in reply to END block not excuting when thread interrupted
I don't have any helpful advice for threaded programming, but would you have any better luck using a pre-existing solution, and using File::Temp for your temp directory?
use File::Temp qw/ tempfile tempdir /; $dir = tempdir( CLEANUP => 1 );
In Section
Seekers of Perl Wisdom