my $interrupted = 0; $SIG{ALRM} = sub { $interrupted = 1; };