jcorso has asked for the wisdom of the Perl Monks concerning the following question:
test.pl
#!/usr/bin/perl -w use Tk; $main = MainWindow -> new(); $text_box = $main -> Scrolled ("Text",-spacing2=> 1, -spacing3 => 1, -scrollbars => "e", -height => 20, -background => "white", -relief => "ridge") +->pack(); $start = $main->Button()->pack(); $start-> configure (-text => "Start", -command => [\&count]); MainLoop(); sub count { open(README, "test3.pl |") or die "Can't run program: $!\n"; while(<README>) { $text_box -> insert ("end", $_); } close(README); }
test3.pl
Them the problem is that test.pl has to wait until test3.pl is finished, to show the log in the textbox. What I want is that the STDOUT of test3.pl is showed in the textbox while it is been executed. Thanks in advance for your help, and excuse me if it is silly question.#!/usr/bin/perl -w print “Write something: \n”; while (<>) { print; if ($_ =~ /aaa/){ exit; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Processing STDOUT of a called perl script during execution
by moritz (Cardinal) on Mar 10, 2008 at 14:47 UTC | |
|
Re: Processing STDOUT of a called perl script during execution
by almut (Canon) on Mar 10, 2008 at 15:16 UTC | |
by shmem (Chancellor) on Mar 10, 2008 at 16:20 UTC | |
by almut (Canon) on Mar 10, 2008 at 16:29 UTC | |
|
Re: Processing STDOUT of a called perl script during execution
by shmem (Chancellor) on Mar 10, 2008 at 16:12 UTC | |
|
Re: Processing STDOUT of a called perl script during execution
by halfcountplus (Hermit) on Mar 10, 2008 at 15:18 UTC | |
|
Re: Processing STDOUT of a called perl script during execution
by zentara (Cardinal) on Mar 10, 2008 at 16:29 UTC | |
|
Re: Processing STDOUT of a called perl script during execution
by jcorso (Initiate) on Mar 10, 2008 at 18:18 UTC |