in reply to Re: capturing STDOUT after Win32::Process::Create()
in thread capturing STDOUT after Win32::Process::Create()

I was afraid of that...the problem is, I have to "Wait"
after $COUNTERS_NAME executes for one minute. If I use your
open command, I won't be able to execute another perl command
while $COUNTERS_NAME executes...

Can I set STDOUT to go to a file before calling
Win32::Process::Create(), then set it back when done?
Thanks so far, your comment cleared up a confusing
post from a less prestigious source...
  • Comment on Re^2: capturing STDOUT after Win32::Process::Create()

Replies are listed 'Best First'.
Re^3: capturing STDOUT after Win32::Process::Create()
by bart (Canon) on Nov 30, 2004 at 18:40 UTC
      I used plain old open(), as and came to realize that I
      shouldn't even need the wait...the process I kick off
      executes a step, waits one min. then does it
      again...the time between the 2nd execution step and the
      end of the process is negotiable, I can let it
      finish then run the command I thought I needed a
      "Wait()" for. I've just never played with open
      commands till now...they are a bit confusing at first
      glance.

      btw the chatterbox client is pretty cool, I got it to fire
      up, but I haven't connected yet to perlmonks...
Re^3: capturing STDOUT after Win32::Process::Create()
by ikegami (Patriarch) on Nov 30, 2004 at 18:04 UTC
    If I use your open command, I won't be able to execute another perl command while $COUNTERS_NAME executes...

    Not true, you can.

    I have to "Wait" after $COUNTERS_NAME executes for one minute.

    You can use sleep(60), or poll time, ...

    Can I set STDOUT to go to a file before calling Win32::Process::Create(), then set it back when done?

    I think you could execute cmd /c mycommand args > outputfile instead of just mycommand args