in reply to Re: Re: Sending and recieving data
in thread Sending and recieving data

While I would agree that if you look at POE from a low level, there is quite a learning curve to surmount - However, for use in a real-world, practical sense, POE isn't nearly as difficult as it first seems. The documentation at http://poe.perl.org is a bit patchy in places, but it is improving.

For example, from the POE cookbook documentation, the following code acts as a non-blocking echo server, much like what the venerable Anonymous Monk seeks and is relatively straight-forward to follow:

#!/usr/bin/perl use POE; use POE::Component::Server::TCP; use strict; POE::Component::Server::TCP->new ( 'Alias' => "echo", 'Port' => 2000, 'ClientInput' => sub { my ( $session, $heap, $input ) = @_[ SESSION, HEAP, ARG0 ]; $heap->{client}->put($input); } ); $poe_kernel->run(); exit 0;

 

perl -le 'print+unpack("N",pack("B32","00000000000000000000001000110100"))'