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

my $klient;
my $port = 7777;
my $ip = "192.168.0.10";

my $server = IO::Socket::INET->new(
    Proto     => "tcp",
    LocalPort => $port,
    LocalAddr => $ip,
    Listen    => 2,
    Reuse     => 1
) or die "Chyba pri vytvareni serveru! $!";

$klient = $server->accept();

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