Look at Win32 Process Output you may have to do some serious STDOUT redirecting stuff though. Here is some code..
Name.exe is a helloworld type program that returns a name to STDOUT.#!perl.exe use Win32::Process; pipe(READ, WRITE); close(WRITE); select(READ); $| = 1; select(STDOUT); open(SAVEIN, "<&STDIN") || die "Can't save STDIN\n"; open(STDOUT, "<&READ") || die "Can't redirect STDOUT\n"; select(STDIN); $| = 1; select(STDOUT); Win32::Process::Create($Process, "c:\\dev\\MiscTests\\Process\\name.exe", "name", 1, NORMAL_PRIORITY_CLASS, ".") or die &Error; chomp($num = "&READ"); open(STDIN, "<&SAVEIN"); close(SAVEIN); close(READ); sleep 5; print "\n\n================================\n"; print "You entered $num\n"; print "About to terminate....\n"; print "End.\n"; sub Error { print Win32::FormatMessage( Win32::GetLastError() ); } open(FILE, "processlog"); chomp( my $var = <FILE> ); close(FILE);
HTH
-----In reply to Re: Capturing error messages from Win32::Process
by AcidHawk
in thread Capturing error messages from Win32::Process
by qadwjoh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |