Hello.
Running Activestate 5.16 on Win32.
I have a program that will generate output continually, I need to only capture output to a file for a little while.
I can't seem the exit the while loop tho' any ideas?
I tried until(), last().....
Must I put a space in $arg0 ? e.g. $arg0 = " \"arb..\"";
-----------------------------
#!perl
$program = "c:\\progdir\\bin\\proggie.exe";
$dstfile = "d:\\scripts\\log\\archive\\proggie.log";
$arg0 = "\"Blah.Blech.>\"";
$timeout = 60;
$starttime = time;
open( PRG, "$program $arg0 |") || die "Couldn't open PRG: $!\n";
open (LF, ">$finaldest");
while (<PRG>) {
print LF "$_";
$difftime = time - $starttime;
last if ($difftime > $timeout);
}
close (LF);
close (RVRD);