Seems to me you should use Time::HiRes. I use that one combined with Tk's after metod and it works well for me but my prog can have larger errors then yours.
Comment on Re: making something happen in real time
Seems to me you should use Time::HiRes.
Ah, thanks, that's helpful! That fixes the portability problem with using `date`. Calling Time::HiRes::usleep instead of using select didn't fix the latency problem, though.