[Gllug] perl question

Jack Bertram jack at jbertram.net
Mon Mar 5 09:45:59 UTC 2007


I have a little perl script which uses ncurses to display a list of
mailboxes, checks new mail, allows me to run various commands and so on.
It works perfectly, but - essentially because the main body of the
program is an infinite loop which checks for keypresses and for mailbox
updates - uses 50% of my CPU time.  No problem on my main machine but a
bit of a pain for the little arm box that I'm going to migrate to.

Anyone know if there is a canonical way of writing the main loop to stop
this happening in perl?  I only need to poll the mailboxes once every
few seconds, but I need to respond to keypresses instantly, so a sleep()
call won't work.

thanks,
jack

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20070305/3ebb29bd/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list