cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Perl API

From: Matt Kynaston <kynaston_at_yahoo.com>
Date: Wed, 4 Jul 2001 11:41:17 +0100

Cris,

Thanks for the quick response.

Think I've got it all working now, though in a few places it doesn't do what
it should. If it's any use to you, here's the errors/warnings I get running
test.pl with -w (version 1.1.5, perl 5.6.1, Curl 7.8 on Red Hat 7.0):

Use of uninitialized value in subroutine entry at test.pl line 78
- think $myheaders[..] need to be null terminated
Use of uninitialized value in subroutine entry at test.pl line 96
- $bytes not set after successful read
Use of uninitialized value in subroutine entry at test.pl line 98
Use of uninitialized value in subroutine entry at test.pl line 99
- $realurl and $httpcode are, however, set
Use of uninitialized value in subroutine entry at test.pl line 305
- again, $bytes empty

I'm using it to regularly scrape subscriber info from a billing company's
customer interface and update my client's database. Pretty specific use, but
I'll send in the scripts once they're tidied up if you're still looking for
examples.

Yes, a more perlish, OO interface would've made figuring it out a little
easier for us non-C weenies ;)

Matt

----- Original Message -----
From: "Cris Bailiff" <c.bailiff_at_awayweb.com>
To: "Matt Kynaston" <kynaston_at_yahoo.com>
Sent: Wednesday, July 04, 2001 12:54 AM
Subject: Re: Perl API

> Hi Matt,
>
> I recently did some work on upgrading the perl interface (adding
> callbacks and extending the test script etc.), which is probably the
> version you're looking at - I attempted to update the docco for the new
> calls I added, but didn't re-visit or test the existing work.
>
> The best example useage is still the 'test.pl' regression script
> included in the package I think - I've used Curl::easy OK in a couple of
> perl projects, but I've not used every feature from perl - the interface
> really is a fairly 'raw' wrapper round the C interface (originally
> written by a C programmer), so its not very 'perlish' in many places.
>
> When I get chance (?) I would like to work on revamping some of the
> core code, to make the interface OO and more of the options work 'like
> perl' instead of 'like C' - there are still a few C issues (like null
> terminations etc.) and issues with defaults (like, having to turn off
> progress and verbose etc.) to make scripts simpler to put together -
> Daniel has done good work in curl 7.8 to rectify some of these things,
> so I'd like to reflect that in the perl interface.
>
> Of course, if I do that, I've got to keep backwards compatibility as
> well...
>
> Cris Bailiff
>
> P.S. I had to reply directly, rather than to the list, as sourceforge
> continues to reject my email with some bizzare address validation error,
> despite hours of DNS jiggling and help from Daniel. Feel free to forward
> to the list...
>
>
> Matt Kynaston wrote:
> >
> > Hi all,
> >
> > Does anyone know of *any* more documentation/examples for using
Curl::easy
> > from Perl, other than what's avail from perldoc and at
> > http://curl.haxx.se/libcurl/perl/? All the stuff in the 'programs'
section
> > seems to use straight shell calls instead of the package.
> >
> > I am getting by with the C API docs, but keep stumbling. Took me ages to
> > figure out that I had either to end CURLOPT_POSTFIELDS (and other stuff)
> > with ASCII zero, or send CURLOPT_POSTFIELDSIZE.
> >
> > The docs seem to indicate you don't need to, and even the test script
> > supplies gets it wrong when sending CURLOPT_HTTPHEADER.
> >
> > Or am I missing something?
> >
> > Thanks,
> >
> > Matt

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
Received on 2001-07-04