[Melbourne-pm] HTTP server-like module?

Toby Corkindale toby.corkindale at strategicdata.com.au
Wed Nov 26 19:12:30 PST 2008


Malcolm Herbert wrote:
> On Thu, 27 Nov 2008 13:40:12 +1100, "Steve Sabljak" <steve at sabljak.org>
> said:
>> Would HTTP::Request & HTTP::Response from libwww-perl not do the trick?
> 
>>From my understandong of it, these are for handing data around between
> objects but don't to any parsing themselves ... 

use IO::Socket::INET;
use HTTP::Request;

my $sock = IO::Socket::INET->new(LocalPort => 'http');
# etc
my $bytes = $sock->read(.....);

my $request = HTTP::Request->parse($bytes);
my $user_agent = $request->headers->('UserAgent');

tjc

-- 
Strategic Data Pty Ltd
Ph: 03 9340 9000


More information about the Melbourne-pm mailing list