#add to thread: $SIG{'TERM'} = sub { threads->exit(); }; ## just before the 'join' add: $thr -> kill ( "SIGTERM" );