cURL / Mailing Lists / curl-library / Single Mail

curl-library

New Perl interface to libcurl - WWW::Curl::Lite

From: Sebastian Riedel <sri_at_oook.de>
Date: Sun, 15 Feb 2004 22:23:27 +0100

Hi,

I would like to announce a new Perl module named WWW::Curl::Lite
that provides a very perlish, easy to use OO interface to WWW::Curl.

Instead of the official WWW::Curl 2.0 it uses my inofficial 3.0 release.
My WWW::Curl 3.0 has many new features such as multi support!
Many things were rewritten from scratch and it's much cleaner.

The only downside is that it's incompatible to version 2.0.

Here are two examples that show how easy WWW::Curl::Lite is.

Oneliner:
--------------------8<------------------------
Perl -MWWW::Curl::Lite -e 'print WWW::Curl::Lite->get("http://oook.de")'
--------------------8<------------------------

Simple parallel download:
--------------------8<------------------------
#!/usr/bin/perl -w
 
use strict;
use WWW::Curl::Lite::Request;
use WWW::Curl::Lite;
 
my $curl = new WWW::Curl::Lite;

my $request1 = new WWW::Curl::Lite::Request({ url => 'http://oook.de' });
$request1->postfields('curl=cool');
my $request2 = new WWW::Curl::Lite::Request;
$request2->url('http://files.oook.de');

$curl->register($request1);
$curl->register($request2);
my $responses = $curl->request;

foreach my $response (@$responses) {
    print $response->content;
}
--------------------8<------------------------

Simple, isn't it? :)

I told Cris Bailiff, the current maintainer of WWW::Curl about it and
sent him a patch, but he doesn't respond for about three months,
when he told me that he would use my modifications for a future
version. :(

Currently none of the modules are on CPAN and i wont upload
anything until the thing with Cris is cleared.

But you can grab actual versions from http://oook.de/?WWWCurl
and http://oook.de/?WWWCurlLite.

Cheers,
Sebastian Riedel
Received on 2004-02-15