in reply to Re: Re: reading output from another script
in thread reading output from another script
In that case, the code I included above is exactly what you want.
As for 50 lines at a time - it's not really happening that way. The above loops will do things line by line as they are output. I bet it's just buffered output that is the problem.
You may have to unbuffer the original script (if it's perl, use the same solution - if it's not perl, I'm not sure what you can do). However, if it normally produces even output, then just fix the monitor.pl script.
You can unbuffer the output from your monitor.pl perl script with:
As a side note, I bet your email gets sent immediately, it is just the text output to the screen that is buffered.
~Jon
As for 50 lines at a time - it's not really happening that way. The above loops will do things line by line as they are output. I bet it's just buffered output that is the problem.
You may have to unbuffer the original script (if it's perl, use the same solution - if it's not perl, I'm not sure what you can do). However, if it normally produces even output, then just fix the monitor.pl script.
You can unbuffer the output from your monitor.pl perl script with:
or as an alternative$| = 1;
This should produce smooth, line by line output, as it is generated by the original script.use FileHandle; STDOUT->autoflush;
As a side note, I bet your email gets sent immediately, it is just the text output to the screen that is buffered.
~Jon
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: reading output from another script
by Octavian (Monk) on Jul 24, 2003 at 16:59 UTC |
In Section
Seekers of Perl Wisdom