in reply to Managing an asynchronous neverending external program

Genaral advice: Use an Event-loop system, which runs on Windows, like AnyEvent or Glib . Your event loop will spawn the program, in a way to get it's PID. Your eventloop runs a timer, to see when that troublesome program has finished, and then sends a Kill signal to it. See Roll your own Event-loop for a simple example.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Managing an asynchronous neverending external program

Replies are listed 'Best First'.
Re^2: Managing an asynchronous neverending external program
by Porax (Acolyte) on Jul 09, 2014 at 12:41 UTC

    Thanks a lot zentara !

    I just started having a look at AnyEvent and for what I have read so far it really seems to reach my needs !

    Porax

      Be aware that Perl on Windows has some rough edges and IPC and event-based programming tend to get into those edges the most!

        I saw your message just after I tried a simple example with any event and saw it wasn't working.

        I'll keep on trying different things. And see what seems to work the best.

        I'll share it later if (when !) I manage to do something that runs !

        Porax