How do I timeout a slow event?

Use the alarm function, probably in conjunction with a signal handler, as documented Signals and chapter 6 of the Camel. You may instead use the more flexible Sys::AlarmCall module available from CPAN.