($pid = open (CHILD,"-|"))||exec "perl script.pl"; $main->fileevent(\*CHILD,'readable',[\&fill_text_status]); sub fill_text_status{ $_ =; if (/^EOF$/){ #child send EOF if done kill ("TERM",$pid) if $pid; $pid = undef; close CHILD; $main->fileevent(\*CHILD,'readable',''); return; } chomp; $status->configure(-text=>$_); }