The following works for me:
alarm 2; $SIG{ALRM} = \&Finish; sleep 30; sub Finish { print "Timeout reached"; }
But also see perlipc on signals and how they (badly) interact with filehandles.
In reply to Re: Print inside SIGNALS
by Corion
in thread Print inside SIGNALS
by pedrete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |