# Simple echo server using POE framework (from CPAN) #!/usr/bin/perl use warnings; use strict; use POE qw(Component::Server::TCP); POE::Component::Server::TCP->new( Port => 12345, ClientInput => \&client_input, ); POE::Kernel->run(); exit; sub client_input { my ($heap, $input) = @_[ HEAP, ARG0 ]; print "[$$]: $input\n"; $heap->{client}->put($input); }