in reply to Do-nothing loops

You could replace all your code with:

$|++; sleep 5 if -s $logfile;

This code gets your program to sleep for 5 seconds unless $logfile has a non zero size (-s filetest). You don't need to open a file and check its contents is not blank. If this is the case it will have a size greater than zero. For the filetest operators see perlman:perlfunc:alphabetical and look for -X. The $|++ will flush the buffers. The code if (@file != "") is the same as if (@file) BTW

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.