Help for this page
# supposing the program output is all stored in $text: $text =~ s/.*\r//g;
# you need to know which line number you're at in the Tk::Text buffer # -- let's suppose that's in a variable called "$line_number" ... $tktext_widget->Insert( $string ); $line_number += ( $string =~ tr/\n// ); }