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.


In reply to Re^4: Run and Stop another program in perl by dasgar
in thread Run and Stop another program in perl by fast

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.