Re: WWW module for the perl5 library

Martijn Koster (m.koster@nexor.co.uk)
Fri, 24 Feb 1995 08:54:12 +0000


Tim Bunce wrote:

> This might not have happened if anyone had told me about Martijn
> Koster's work so that I could add his WWW:: modules to the Perl 5
> Module List.

'work' might be a bit of an overstatement.

> The list is specifically intended to prevent this kind of
> duplication of effort.

> Roy or Martijn, did you know about the Module List?  Gisle, did you
> check the Module List?

I learnt about the Module List from perl5-porters, but only after
doing the work. I nearly mailed you to have it added but decided to
discuss it on the libwww-perl@ics.UCI.EDU list first, as the obvious
forum for design of this specific functionality. Gisle, were you not
on that list too? As it happened nobody showed much interest there,
maybe because many people still live in the Perl4 age. As I don't have
the time yet to complete/test/perfect the software I decided to leave
it for now (famous last words); I noticed that WWW was on the list as
an idea already anyway.

So I picked a smaller, more specific, forum rather than a wider one.
I probably should have registered my name (or the libwww-perl list) as
an interested party though.

Roy wrote:

Roy> I don't want to sound ungrateful -- I really am glad that people
Roy> are porting it to Perl5 (I don't have the time to do it myself).
Roy> It'sj ust that the project goals and history are intended to 
Roy> promote collaboration, not just implementation, and I do not want
Roy> to see that disappear.

As so often I share Roy's sentiments. I didn't want to rush some of my
ideas into a "the next final and official" WWW Perl integration
project until a design was proven to be sensible, all the parts of the
current libwww-perl were available in it, and other interested parties
had given some feedback. I think perl5 modules are a great opportunity
to provide this functionality in a standard way, and doing it right.

> I'd like to understand why the list 'failed' in this case so I can
> try to prevent it happening again.

I must admit I wasn't 100% clear on the distribution of the Module
List, and thought it might be distributed with the Perl5.001
distribution. If this is so it might discourage people from entering
their name/email addresses, especially when ideas are only in the
"interesting plaything" stage. The last thing I want is people
hassling me to finish/distribute the work after I have long given up
:-)

Having said that, this is not what dissuaded me to mail you, as
explained above.

> Should I circulate it more widely?  How can I encourage people to
> add their modules to the list? etc etc.

Would you like me add it to my Perl Web page? Where is the latest
version I can point to/mirror?

> And finally, Martijn, could you send me the details of your WWW::
> modules that you'd like me to add to the list. Assuming you do want
> then added...

I'll send you some blurb once I can find the right format.
 
I do suggest we keep the WWW specific discussion on the libwww-perl
list, perl5-porters is busy enough (and in a world of its own anyway :)

Anyway, as a taster, this is what I do with my modules:

    use WWW::HTTP;
    my($htrequest) = new WWW::HTTP;    

    $htrequest->setheader('User-Agent', 'w3p/0.1 libwww-perl5/0.1');
    $htrequest->setheader('From', $w3p::from);
    $htrequest->proxy('ftp', 'http://web.nexor.co.uk:8001');

    my($response) = $htrequest->request('GET', $url);

    ...

    $htrequest->response(
                         # this anonymous subroutine
                         # is repeatedly called with
                         # buffers of data.
                    sub {
                        my($buff, $n) = @_; 
                        print LNK $buff;
                        $totaln += $n;
                    }
    );

-- Martijn
__________
Internet: m.koster@nexor.co.uk
X-400: C=GB; A= ; P=Nexor; O=Nexor; S=koster; I=M
X-500: c=GB@o=NEXOR Ltd@cn=Martijn Koster
WWW: http://web.nexor.co.uk/mak/mak.html