in reply to Trouble with poll code

brian's Guide to Solving Any Perl Problem might help.