in reply to problems with fileevent
but i still wonder if there is a more elegant way to do this ...($pid = open (CHILD,"-|"))||exec "perl script.pl"; $main->fileevent(\*CHILD,'readable',[\&fill_text_status]); sub fill_text_status{ $_ =<CHILD>; 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=>$_); }
NaSe
|
|---|