#!/usr/bin/perl use warnings; use Tk; open(PING, "ping 127.0.0.1 -t |") or die "Fehler: $!\n"; my $mw = MainWindow->new(); my $t = $mw->Text(-width => 80, -height => 25, -wrap => 'none'); $t->pack(-expand => 1); $mw->fileevent(\*PING, 'readable', [\&print_widget, $t]); MainLoop; sub print_widget { my($widget) = @_; $_ = ; print $_; $widget->insert('end', $_); $widget->yview('end'); }