in reply to LWP, extract_cookies, etc.

Your other post featured the use of -w, which is great, but there's no use strict, and that can be dangerous. When debugging, it can sure save your bacon, so make it a habit. It's mean, it complains a lot, but that's just tough love.

If you make a $cookie_jar then you can supply that to your function like $ua->cookie_jar($cookie_jar) instead of doing it twice, as you have questioned yourself doing, though you will want to make sure the $cookie_jar is initialized with the parameters in your second instance.

IlyaM points out a feature of HTTP::Request::Common below which I mistook for an error. Never had any use for these before, I suppose, and bracketless function calls are hard to parse at times.

Replies are listed 'Best First'.
Re: Re: LWP, extract_cookies, etc.
by IlyaM (Parson) on May 22, 2002 at 08:14 UTC
    $ua->simple_request(POST "http://...") is correct Perl code. Have you noticed use HTTP::Request::Common; at the begining of them script ? It exports couple of handy subroutines like GET, POST and HEAD which return HTTP::Request object. See documentation for HTTP::Request::Common.

    --
    Ilya Martynov (http://martynov.org/)