Home: Perl Programming Help: Win32 Programming Help:
Redirection in Win32::Process



vmnaren
New User

Oct 16, 2008, 3:10 AM


Views: 7571
Redirection in Win32::Process

I am trying to capture the output of the background process in a log file(redirectFile) using redirection but the redirectfile does not get created at all.

$cmd = "<exe name> > redirectFile";
Win32::Process::Create(my $obj, getExecVersion($proc), $cmd,
0,NORMAL_PRIORITY_CLASS, $wd)

Please help in this regard.


KevinR
Veteran


Oct 16, 2008, 11:54 AM


Views: 7565
Re: [vmnaren] Redirection in Win32::Process

More than likely this is a problem:

my $obj

at that point $obj has no value even if it did previously. Remove the 'my' and retry your code.
-------------------------------------------------