cURL / Mailing Lists / curl-library / Single Mail


Re: the first basic OO perl interface

From: Cris Bailiff <>
Date: Sat, 22 Sep 2001 08:55:29 +1000


        I'd like to include the OO interface and Curl_easy into one perl package. People
shouldn't really need 2 packages for this extra functionality.

I'd like to think through the naming issues to see what the implications for
package, function and directory names are. Are you happy with the name 'Curl' as
the object class? If so, the .pm file name should be '' and then you
should 'use Curl'. (Class names and File names should match, and classes are
'Captialized::By::Perl::Convention'. We can/should roll 'Curl' and 'Curl_easy'
into one package, but it would then be called 'Curl-x.x.x.tar.gz', not
'Curl_easy' (as the top of the namespace).

(Also, CPAN generally tries to name things a bit more hierarchically, so it would
be good to plan that now - for example, would you object to 'Net::Curl' instead?
(Also pre-avoids the 'curl' language interface debate, unless you'd like to get
in and claim the namespace early :-) )...

I've got some more sample 'OO' code written by one of our guys here - (Curl::OO)
- which is similar to yours but has a few more methods. We haven't 'released' it
because its needs a bit more work (generalization, naming issue...) to be of
general use, but I can post it as another example.

I'd be happy to roll these beginnings into the start of a more fully featured
'Curl' package - you're succeeding in goading me into addressing this part of the
interface asap..

I don't want to 'take over' the OO part, or discourage your work, I just want to
make sure we get a 'unified' result, and don't commit to an inflexible interface
early on - the right OO interface could be really good.... I'd suggest you read
'perldoc perlmodlib' and then use 'h2xs' to make a skeleton package if you'd like
to make the current code look more 'real'.


Daniel Stenberg wrote:
> Hej
> I have this first (very basic) version of an OO interface to curl:
> Now, I thought I could move this into the perl source tree to better enable
> more people to develop it and view it.
> Does anyone have a suggestion on where in the source tree to put it and
> possibly what to name it?
> Simply call it 'curl' and use perl/curl/ ?
> Would it make sense to make a separate CVS module for the perl stuff?
> --
> Daniel Stenberg -- curl groks URLs --
Received on 2001-09-22