Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello. The code below works great! Except that it spurts output the console, how do I capture that output into $var ? I tried appending " > $outfile" to $arg0, but get an error (proggie still keeps on running though until $endtime > time). C.
use Win32::Process; $program = "c:\\perl\\scripts\\tail.exe"; $outfile = "c:\\perl\\scripts\\new_logfile.txt"; $arg0 = " -f c:\\perl\scripts\\logfile.txt"; $endit = time + 60; Win32::Process::Create($ProcessObj, "$program", "$arg0", 0, NORMAL_PRI +ORITY_CLASS, ".")|| die ErrorReport(); until ($endit > time) { next; } $pid = $ProcessObj->GetProcessID(); Win32::Process::KillProcess($pid, $exitcode);