#!/usr/bin/perl use common::sense; use Glib qw/TRUE FALSE/; $SIG{'SIGRTMIN+5'} = \&on_sig; my $loop = Glib::MainLoop->new( 'default', FALSE ); $loop->run; sub on_sig { my $sig = shift; say "somebody told me $sig"; } #### $ ./t_signal.pl & [2] 3305 $ kill -s SIGRTMIN+5 3305 $ [2]+ Real-time signal 5 ./t_signal.pl $