I forgot to mention, the other solution to timeouts, and that is to use an event-loop system like
POE or
Glib. An event loop system will let you setup timers and you can then time other spawned threads. I prefer Glib myself, but see
the POE cookbook for possible ready made solutions. Or see
Roll your own Event-loop for how to use Glib, but Glib may be a bit hard to install on Win32 without installing Perl/Gtk2.
It is easily installed with
Camelbox: A build of Gtk2-Perl for Windows