in reply to Re^3: Run and Stop another program in perl
in thread Run and Stop another program in perl

After reading BrowserUK's last post on this, I've got one really crazy "out of the box" idea. I'm sure that there will be some who will consider this idea to be ugly and I could not disagree. Also, it's not a purely Perl solution.

Ok, here's the crazy (stupid???) idea of mine. First, it sounds like your running on Windows, which is the basis for my idea. One good source of line command utilities for the Windows environment is the Sysinternals suite, which is available for free from Microsoft. In this case, you'll be interested in the pskill tool, which allows you to kill a process by name from a line command (i.e. the equivalent of killing a process via task manager).

Here's the outline of what I'd try if I were in your place.

It may be an ugly solution, but it just might work. Also, it won't directly capture the output of your program.exe in Perl. Perhaps someone else might have a better Perl-based idea, but this is the best idea that I could come up with based on my knowledge of Perl.

Good luck with your efforts.