in reply to Generating Delay

see the built-in sleep function ... also Time::HiRes as needed... you may also just want to flush the buffer during write w/$|=1 (see perlvar and Suffering from Buffering?)