in reply to Re: (tye)Re: TK Problem (me again)
in thread TK Problem (me again)
If you have 10 lines waiting from LOG, let Tk call your function 10 times. (Unread data still counts as a readable event, I would suspect, but I am assuming Tk implements this using select.)sub insert_text { local($_) = <LOG>; # process 1 waiting line if (/(CRITICAL|MAJOR)/) { $text->insert('end', $_, $1); } else { $text->insert('end', $_); } }
You'll have to do something else entirely (is there an 'eof' filevent? an error one?) I suspect to set yourself up to clear the readable event for that file handle, unless insert_text will be called when eof(LOG) is true.
|
|---|