#!/usr/bin/perl -w use IO::Socket; my (@anruf, $line, $i); $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "192.168.2.1", PeerPort => "1012", ) or die "cannot connect to daytime port at localhost"; while ( <$remote> ) { $line = <$remote>; @anruf = split(/;/, $line); if ($anruf[1] =~/RING/) { print "Ankommend"; } else { print "no"; } }; close $remote;