in reply to Script heartbeat to show it is still running

If your script is taking quite a while to run, its probably a loop or two thats doing most of the work. So, somewhere in your loop, just have your program output a "." every once in a while:
use constant PROGRESS_CHUNK_SIZE => 1000; my $counter = 0; while ( ... ) { # loop that takes a long time to run ... $counter++; if ( !($counter % PROGRESS_CHUNK_SIZE) ) { print "."; } }
You may want to alter the PROGRESS_CHUNK_SIZE value, depending on how long 1 loop iteration takes.

Replies are listed 'Best First'.
Re: Re: Script heartbeat to show it is still running
by sauoq (Abbot) on Jul 04, 2003 at 01:01 UTC

    This may or may not work depending on the structure of the OP's code, but if it is going to be useful at all, autoflush will have to be set on the output filehandle. A $|++; near the top of the program will probably suffice.

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: Re: Script heartbeat to show it is still running
by Anonymous Monk on Jul 07, 2003 at 11:46 UTC
    Thanks!!!!