
alarm(10);	#set a system alarm for the future
$SIG{ALRM} = 'weTimedOut'; #call this sub if alarm expires

{#some block of code, maybe a subroutine, a loop, whatever
  local $SIG{ALRM} = 'disaster';
  #...
  #..
  }
