#!/usr/bin/perl use strict; use warnings; use IO::Socket; my $sock = IO::Socket::INET -> new (LocalAddr => "localhost:5000", Listen => 5) or die $!; while (my $child = $sock -> accept ()) { my $line = <$child>; print $child "You send: $line"; close $child; } __END__