checkEvent is an example.
You can have your interrupt code or procedure to capture keystroke instead.
Follow these links
http://www.perlmonks.org/?node_id=534650
http://systhread.net/texts/200009pi.php
Vishy
Comment on Re^3: how to sleep-awake on perl script?