cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Perl multicurl

From: Balint Szilakszi <szbalint_at_cpan.org>
Date: Thu, 07 May 2009 21:38:26 +0200

Kenny Billiau wrote:
> Hi,
>
> I'm trying to do a multicurl request which behaves a bit odd.
> When I 'perform' the multicurl handle, it seems all easy_handles are executed
> with the URL of the last added handle. I tried to circumvent this problem by
> POSTing instead, but somehow, the POST params don't get attached (But for this
> I may be doing something wrong).

Interesting. Would be good to know more about your environment...

>
> So, I've got two questions:
> 1/ what's messing with the passed url in the easy_handles?
> 2/ how can I attach POST params? I've tried two ways, just look at the
> following code, without success. But I think both should work, sort of.
> (3/ constants like CURLOPT_COPYPOSTFIELDS don't seem to work either)

All I can say is, worksforme(TM), but the lack of CURLOPT_COPYPOSTFIELDS might be an indication of an old version of
libcurl that you have on your system.

What does curl-config --version say?

> I've googled around a lot, but it seems perl en cURL don't do a happy dance
> together.
> I'm a bit confused if WWW::Curl::Easy and WWW:Curl::Multi are still maintained,
> and if they are recommended to be used or not. If you briefly google the
> maillist archives, it's even mentioned that the curl package for perl is not
> really as steadily maintained as their python equivalents. Is this still the
> case?

I'm a maintainer for WWW::Curl, the Perl binding for libcurl.

I've released 4.06 barely a month ago.
http://search.cpan.org/~szbalint/WWW-Curl-4.06/

WWW::Curl has a test suite, with an improving test track record.
http://www.cpantesters.org/show/WWW-Curl.html#WWW-Curl-4.06

There are no reported and unfixed bugs in RT:

http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Curl

I also monitor the debian bugtraq for the debian packaged version of WWW::Curl. There are no unfixed bugs outstanding
there either.

http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=libwww-curl-perl

I've recently collaborated with Andreas Marienborg and he released WWW::Curl::Simple, to provider a higher level wrapper
around WWW::Curl, so you don't have to know about the C-style underpinnings, if you don't want to (maybe you'd like to
contribute some patches to WWW::Curl::Simple as from the code you've posted it seems that you're trying to do much the
same by rolling your own wrapper?).

http://search.cpan.org/~andremar/WWW-Curl-Simple-0.03/lib/WWW/Curl/Simple.pm

I guess it all depends on your needs. If you find a bug and report it, I'm happy to fix it or pass it upstream, if you
don't I can't do much about it.

It is true that the Perl libcurl binding wasn't very active in the past few years. However, that's slightly changed now,
so I'm glad to report there is life here. :)

Regards,
Bálint Szilakszi
Received on 2009-05-07