use IO::Socket::INET; $file = "info.txt"; #open(stdout,">>$file"); ### one way of trying to output to a file $sock = IO::Socket::INET->new( PeerAddr => '10.8.74.227', PeerPort => '7070', Proto => 'tcp'); print "client running\n"; my $byte; while (sysread($sock, $byte, 1) == 1) { print $byte; } close($sock);