in reply to ^CSIGINT handler "my_handler" not defined. Sigtrap is not able to find handler function.
You need to provide more context if you want help but reduce it down to a minimal example that still does not work. Here's my minimal yet working example:
#!/bin/env perl use strict; use warnings; use sigtrap 'handler' => \&my_handler, 'normal-signals'; while ( 1 ) { print "running...\n"; sleep 30; } sub my_handler { die "Caught signal $!\n"; }
|
|---|