#!/home/utils/perl/bin/perl use strict; use warnings; use IO::Socket; my $server = IO::Socket::INET->new(LocalPort => 4444, Reuse => 1, Listen => 10); die $@ unless $server; print "waiting for a connection\n"; while (my $client = $server->accept()) { my $line = <$client>; print $line; close($client); }