#!/usr/bin/perl use warnings; use strict; use Tk; use IO::Socket; use IO::Select; my $socket = IO::Socket::INET->new ( PeerAddr => '127.0.0.1', Type => SOCK_STREAM, PeerPort => 2005, Proto=>"tcp" ) or die "kann Server nicht kontaktieren\n"; my $select = IO::Select->new(); $select->add($socket); my $main = MainWindow->new(); $main->repeat(50, \&read_sock); sub read_sock { my @ready = $select->can_read(0); print "es liegt eine neue Message vor:\n"; } MainLoop();