Pcore::HTTP::Server
my $svr = Pcore::HTTP::Server->new( listen => '//127.0.0.1:80', on_request => sub ($req) { return 200, [ 'Content-Type' => 'text/html' ], 'body'; } ); # asynchronous response on_request => sub ($req) { async { $req->( 200, [ 'Content-Type' => 'text/html' ] ); $req->('data1'); $req->('data2'); $req->finish; return; }; return; }
To install Pcore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pcore
CPAN shell
perl -MCPAN -e shell install Pcore
For more information on module installation, please visit the detailed CPAN module installation guide.