Redéfinir le hash %SIG pour le signal à intercepter et déclencher une action :
#!/usr/local/bin/perl
use strict;
use POSIX qw(        :signal_h        );
$SIG{HUP} = \&hup;
sub hup
{
        print "Signal HUP received\n";
}
while(1)
{
        print "-$$-\n";
        sleep(1);
}