#!/usr/bin/env perl
use strict;
use IO::Socket;

my $port = 7777;
my $ip_serveru = "192.168.0.10";

my $vzdaleny = IO::Socket::INET->new(
    Proto    => "tcp",
    PeerAddr => $ip_serveru,
    PeerPort => $port
) or die "Nelze spojit! $!";

while (1){
    print "Zadej text, ktery chces odeslat: ";
    my $odchozi = <STDIN>;
    print $vzdaleny $odchozi;
    my $prichozi = <$vzdaleny>;
    print "PRIJATO: $prichozi";
}

close $vzdaleny;