#!/usr/bin/perl -w package SimpleServer; use strict; use Net::Server; our @ISA = qw(Net::Server); SimpleServer->run( port => 2000, log_level => 4 ); exit; # The subroutine called when a new client connects sub process_request { my $self = shift; my $client = $self->{'server'}; while (1) { my $txt = ; # STDIN and STDOUT are mapped to client $txt =~ s/\r?\n$//; print $txt, "\r\n"; } }