Hi.
I have been using the LWPng distribution which implements HTTP/1.1. I am wondering
how to get the Cookie operations working for LWPng. I tried doing this:
#!/usr/bin/perl -w
require LWP;
require LWP::Debug;
use LWP::UA;
use LWP::UA::Cookies;
use LWP::Request;
use LWP::MainLoop qw(mainloop);
use HTTP::Cookies;
$ua = LWP::UA->new;
$ua->agent("Mozilla/8.0");
$ua->cookie_jar(HTTP::Cookies->new);
$url = "http://www.hotmail.com";
$timeout = 3*60;
$request = LWP::Request->new("GET");
$request->{'done_cb'} = sub { $response = shift;};
$request->url($url);
$ua->spool($request);
mainloop->one_event($timeout) until $response;
if ($response)
{
print "Main page done for $url\n";
if ($ua->cookie_jar->as_string)
{
print "Cookies found\n";
}
else
{
print "No Cookies found\n";
}
}
The error message I get is:
Can't locate object method "epath" via package "URI::http" at
/usr/lib/perl5/site_perl/5.005/HTTP/Cookies.pm line 110.
Does anybody know what is the problem?
Thanks,
Joo Geok