http://www.perlmonks.org?node_id=970257


in reply to Signal Handling

You can set set the handler to a subroutine.

$SIG{INT} = sub { <code goes here> };

See perldoc perlipc.