... my $tail = Tk::IO->new( -linecommand => sub { tail_lines($prch, $text) }); ... }