Help for this page

Select Code to Download


  1. or download this
    # supposing the program output is all stored in $text:
    
    $text =~ s/.*\r//g;
    
  2. or download this
    # 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// );
      }