#!/usr/bin/perl

use strict;
use IO::Socket;

my $socket = IO::Socket::INET->new(
	Listen => 5,
	Proto => "tcp",
	LocalPort => 2345,
	ReuseAddr => 1,
)
or die "Problem: $!";

while (my $client = $socket -> accept) {
	my $line = <$client>;
	print "Verbindung von " . $client->peerhost . ": $line";
	print $client "Demo\r\n";
}
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif