in reply to Screen Output Buffering

you're seeing the effects of buffering. Try "$|=1;" to disable the buffering, or "$temp=$|; $|=1; $|=$temp;" to flush it. If STDOUT is sent to a terminal/console, printing a "\n" will flush the buffer too.