in reply to sleeping for less than 1 second

This is a faq

"If you want finer granularity than the 1 second that the sleep() function provides, the easiest way is to use the select() function as documented in "select". Try the Time::HiRes and the BSD::Itimer modules (available from CPAN)."

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell