sub insert_lines { my $logline; if ($logline =) { $listbox->insert('end', $logline); $listbox->yview('moveto',100); format_text(); } else { $mw->fileevent(LOG, 'readable', ""); } } sub format_text { my $textline; foreach ($textline = ) { chomp; if ($textline =~ /CRITICAL/) { $listbox->configure(-foreground => "red2"); } elsif ($textline =~ /MAJOR/) { chomp; $listbox->configure(-foreground => "DarkOrange2"); } else { } $mw->fileevent(LOG, 'readable', ""); }