in reply to TK infinite scrolling?

And use  index to find number of lines.

>perl -wMstrict -le "use Tk; use constant HEIGHT => 7; my $mw = tkinit(); my $l = $mw->Scrolled(qw'Text -height', HEIGHT); $mw->Button( -text => 'add', -command => sub { $l->insert('end', localtime() . qq{\n}); $l->insert('end', $l->index('end') . ' '); $l->insert('end', int($l->index('end')) . qq{\n}); $l->delete('1.0', '2.0') while int($l->index('end')) > 2 * HEIGHT; $l->see('end'); }, )->pack; $l->pack; $l->insert('end', qq{hi\nthere\n}); MainLoop(); "

And ditto choroba: Please use  <c> tags. Please see Markup in the Monastery.