mpersico has asked for the wisdom of the Perl Monks concerning the following question:
I have a Perl script that has three output modes - print, print in a spawned xterm and output to a Tk::NoteBook. What I would like to do is be able to run the script, output to Tk and then exit the script, leaving the Tk widget up and running.
I've seen a few things about reconnecting stdout/err and fork execing, but I've had no luck, so I think I must be missing something.
I have resorted in the meantime to moving my script X to X.pl and using the following as X:
usingTk=$(echo $* | grep -i -- '-tk') if [[ "$usingTk" == '' ]]; then perl $(basename $0)/X.pl "$@" else perl $(basename $0)/X.pl "$@" & fi
Surely there is a more correct way to do this. Does anyone know it?
Much obliged - Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: backgrounding a Tk process
by zentara (Cardinal) on Oct 09, 2012 at 14:19 UTC | |
by mpersico (Monk) on Oct 10, 2012 at 13:24 UTC | |
by mpersico (Monk) on Oct 10, 2012 at 13:27 UTC | |
by zentara (Cardinal) on Oct 10, 2012 at 14:38 UTC | |
|
Re: backgrounding a Tk process
by bcarroll (Pilgrim) on Oct 09, 2012 at 13:56 UTC |