[Kde-perl] Delayed Text box Output

Rod Butcher rbutcher at hyenainternet.com
Sat Dec 18 10:21:23 CET 2004


Hi Joe, I wrote an almost identical app using Perl & Tk.. I forked the
screen app , and the forked child submitted the background process and
then went to sleep. :-

unless (fork) { # I'm the child
    system(@args); # run helix producer
    open (LOGOUT, "+>>$lf");
    print LOGOUT "\n"; 
    print LOGOUT "END_OF_FILE\n\n"; # append EOF marker
    close (LOGOUT);
    sleep; # child to sleep until killed later along with zombies
    } else { # I'm the parent - read the encoder LOGfile as it's written
    
    $stopb->configure(-state => 'normal'); # activate Stop button
    open(LOGIN, "<$lf");
    read Log etc...........

cheers
Rod


On Fri, 2004-12-17 at 09:24 -0600, Joe Claborn wrote:
> If this is FAQ - someone please point me in the right direction.
> 
> I have a PerlQT application that is the front end for a process that takes 5 
> or so minutes to run. That process is written as a Perl package that I call 
> from my PerlQT application.  I need the process to be able to log status to a 
> text box in the PerlQT application.  
> 
> I added a text box, and a couple of routines to write to the text box and 
> passed the write routine to the Perl package.   It all runs fine - except 
> that all the output to the text box appears at the end of the process run - 
> instead of in real time as it happens.
> 
> Any ideas?
> 
> Thanks,
> 
-- 
-----------------------------------------------------------------------
Brought to you by a penguin, a gnu and a camel



More information about the Kde-perl mailing list