in reply to Running an external GUI program

Hi mdrisser,

It depends.  If, by "external", you mean "on a remote machine", it may be difficult or impossible.  If, though, you just mean separate from your Perl program (as I think you do), there are a number of possibilities.

One is, of course, kill.  It's a bit of a strong measure, though it may be your only recourse.  Update:  Now that I rethink this, kill of course won't work, since your process is remote.  I'm thinking more of a Linux kill; I don't know what the corresponding command is for that on a Mac system, but there must be something.

Alternatively, perhaps the GUI has a non-interactive mode where you can pass it arguments, have it do its work, and then exit?  That's what I do with DVD-burning (which I do at my job); I have a Perl script running on my Windows machine which responds to commands from a Linux box, over a socket.  Then it runs the DVD-burning software in "batch" mode (ie. non-interactively), so that when it's done, it's done (and the DVD-burning software simply exits).


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Running an external GUI program
by mdrisser (Acolyte) on Feb 01, 2007 at 00:50 UTC

    Hi liverpole,

    Thanks for the response.

    By external I meant external to Perl, the GUI resides on the same machine as the Perl code so that's not an issue.

    I thought about using kill, but I need someway to make sure it has finished processing the file before I kill it.