Hi there,

I'm having a small problem using Win32::Process::Create. I'm trying to
run a program compiled from C++ code, but to cope with infinite loops
etc, I need a decent amount of control over the running process...which
is why I'm using Process::Create.

However, I need to capture the output to a file (and in general stop it 
from going to STDOUT). I just can't seem to get it right!

Here's the general jist of what I'm doing:

** Sample code:

#!/usr/bin/perl

use Win32::Process;

$ROOT="D:/tmp/john/project/perl/test";

# Compile source file
`bcc32 "asgn2.cpp"`;

# Run compiled program
Win32::Process::Create($asgnproc,
                        "$ROOT/asgn2.exe",
                        "asgn2",
                        0,
                        NORMAL_PRIORITY_CLASS,
                        ".");

# Wait 5 seconds
$asgnproc->Wait(5000);

# Kill it if still running
$asgnproc->Kill(1);

** End sample code

No matter what I've tried I can't stop the output from going to STDOUT,
and can't direct it into a filehandle. 

I'd appreciate some pointers as to what I'm doing wrong, or even a way
to accomplish what I want without Process::Create (I don't think
system/exec/backticks can give me the control I need...but maybe they
can!)

Regards,

John.

-- 
John McAree     [EMAIL PROTECTED]
"My hole area can't send e-mails either, but I don't 
consider that a problem." - Chronicles of George.
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to