in reply to running status

You cannot do what you are trying via $status whether you use backticks or the system command.

When executed via backticks you will get the results of the program execution, but not until the command finishes executing.

When $status is used with system, the only thing returned is the error code.

What you probably want to do is to run the command as a piped process using open. Here is a very simple example, but you can find more complex examples in either the Programming Perl, Third Edition or Perl Cookbook:

open OGGENC, "c:/oggenc.exe c:/test.wav|" or die "Can't open oggenc.ex +e $!";
This will allow you to read the output of the program as it is running instead of after it's done. HTH.

--Jim

Update: D'oh! Didn't see that you had tried the example, however, it should work for you. Show us your code as maybe there is an error that we can help fix. Also, you're not testing for errors on the open statement and that may provide useful information.

Replies are listed 'Best First'.
Re: Re: running status
by marauder (Novice) on Jan 12, 2002 at 23:06 UTC
    the code i put above using open() still waits for the external command to finish. ommitted error checking I know but the oggenc.exe opens ok. i've come across another problem too. the actual output at the end of it isn't even the full output of the program anyway! i think i may be barking up the wrong tree here, I think I need to find out how to interface to the ogg vorbis encoder DLL library. there is an ogg::vorbis library but this doesn't support encoding which is obviously what I'm after.
      A couple of other things:
      • It may be the wrong approach since if it does produce a spinning slash, you will have to wade through a ton of garbage to find what you want. You might want to try putting a "$|++;" at the top of your program to see if this helps (as you may have a buffering problem see Suffering from Buffering? by our own Dominus).
      • As far as the console (DOS) window, here is a good thread with many viable solutions.

      --Jim

      Update: Fixed "thread" link.