Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: LWP, extract_cookies, etc.

by tadman (Prior)
on May 22, 2002 at 08:10 UTC ( [id://168370]=note: print w/replies, xml ) Need Help??


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/)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168370]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found