use strict; use warnings; use 5.010; use threads; sub thr_func { say 'in thread'; $SIG{'HUP'} = sub { say "signal caught" }; say 'doing some task...'; sleep 5; } my $thr = threads->create('thr_func'); sleep 2; $thr->kill('HUP')->join(); --output:-- in thread doing some task... signal caught