#!/usr/bin/perl use warnings; use Tk; use IO::Socket; my $input = IO::Socket::INET->new (     PeerAddr => '127.0.0.1',     Type => SOCK_STREAM,     PeerPort => 2006,     Proto=>"tcp" ) or die "kann Server nicht kontaktieren\n"; my $mw = MainWindow->new(); $mw->fileevent($input, 'readable', sub {     $mw->configure(-title => "Es funktioniert") }); close($input); MainLoop;