meliason has asked for the wisdom of the Perl Monks concerning the following question:
1. I have a script that envokes a second Perl/Tk script to get some input from the user. The second is standalone because it's general purpose and I didn't want to rewrite it every place I want to use it. Anyhoo, I'm running this second script through a system call:
system("perl path_to_other_script");
If a user decides to exit while in that second script (which is a child process in my mind), how can I tell the parent to exit as well? And can I tell the difference between a user-selected exit versus the script running its course successfully?
2. In each of my Perl/Tk scripts I include a button or a menu option that issues an 'exit' so I can force whatever the script is doing to stop. Works great as long as a user doesn't hit the 'x' in the upper right hand corner of the window. Is there a way to catch that 'x' signal? I've tried creating signal handlers for INT, ABRT, KILL, STOP, and QUIT, but none of them seem to apply.
Any help would be GREATLY appreciated!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling child process and close window exits in Perl/Tk
by rcseege (Pilgrim) on Oct 14, 2006 at 17:37 UTC | |
by rcseege (Pilgrim) on Oct 14, 2006 at 20:45 UTC | |
|
Re: Handling child process and close window exits in Perl/Tk
by zentara (Cardinal) on Oct 14, 2006 at 17:51 UTC | |
|
Re: Handling child process and close window exits in Perl/Tk
by blazar (Canon) on Oct 14, 2006 at 16:57 UTC | |
|
Re: Handling child process and close window exits in Perl/Tk
by meliason (Initiate) on Oct 16, 2006 at 16:56 UTC |