ravishi has asked for the wisdom of the Perl Monks concerning the following question:
MAIN:
#!/usr/bin/perl -w # perlCall.pl use Tk; use TK::ROText; # create the Main Windoow my $mw = MainWindow->new; $resultsBox = $mw->Scrolled('Text', -relief => 'sunken', -width => 100, -height => 32, -background => 'gray90', -scrollbars => 'ose', -selectbackground => 'gray60',)->p +ack(-fill => 'both', -expand => 1); $mw->Button(-text => 'Run Script', -command => \&CallScript)->pack(-fi +ll => 'both', -expand => 1); sub CallScript { @myarray = `perl C:\\IBM\\test_code\\otherScript.pl`; $resultsBox->insert('end', "@myarray"); } MainLoop;
SEPARATE: (otherScript.pl)
As shown in the example, it waits until the full separate script is finished before it displays any of the text. Basically, I want the GUI to act a command prompt that can be updated as the script goes along or at least have text updates. Such as when the first for loop finishes, insert that into the text box. On a less-important question, how do I insert the text without the space in the beginning of each line?#!/usr/bin/perl -w # otherScript.pl for ($i = 0; $i < 10; $i++) { print "This is a test at iteration number: $i\n"; } for ($i = 0; $i < 10; $i++) { sleep (1); print "Testing $i, \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling another script from Perl/Tk
by zentara (Cardinal) on Oct 22, 2008 at 20:55 UTC | |
|
Re: Calling another script from Perl/Tk
by Illuminatus (Curate) on Oct 22, 2008 at 20:00 UTC | |
by ravishi (Acolyte) on Oct 22, 2008 at 20:27 UTC | |
by Illuminatus (Curate) on Oct 22, 2008 at 20:35 UTC | |
|
Re: Calling another script from Perl/Tk
by Anonymous Monk on Jan 28, 2009 at 11:52 UTC | |
by Anonymous Monk on Jan 29, 2009 at 04:03 UTC |