SPUG: Re: HTTP::Cookies question
Richard Anderson
richard at richard-anderson.org
Thu Feb 28 14:33:12 CST 2002
>From perldoc HTTP::Cookies:
SYNOPSIS
use HTTP::Cookies;
$cookie_jar = HTTP::Cookies->new;
$cookie_jar->add_cookie_header($request);
$cookie_jar->extract_cookies($response);
$request must be a request OBJECT created by LWP::UserAgent (or some other
method I'm unaware of), not a URL. HTTP::Cookies tried to invoke a method
named "url" in the parameter you passed to add_cookie_jar.
Cheers,
Richard
richard at richard-anderson.org
www.richard-anderson.org
www.raycosoft.com
----- Original Message -----
From: "S Bullo" <sweetsue at sweethomes.com>
To: "Seattle Perl User's Group" <spug-list at pm.org>
Sent: Thursday, February 28, 2002 8:35 AM
Subject: SPUG: HTTP::Cookies question
> Once again, I have a question concerning a module (what a surprise, eh?).
I
> have determined that my script needs a way to implement cookies with a few
> urls. From checking, I assumed that HTTP::Cookies would be what I need.
I
> can't seem to get into my head exactly how this works. I have:
>
> ... (other coding)
> use HTTP::Cookies;
> ... (other coding)
> my $cookie_jar = new HTTP::Cookies();
> ... (other coding)
> my $url =
>
"http://$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]&subject=$row[7]&me
> ssage=$row[8]";
> my $cookie = HTTP::Cookies->add_cookie_header($url);
> ... (other coding)
>
> When checking it, I see:
>
> "Can't locate object method "url" via package (here my url information is
> listed out in detail) at Cookies.pm line 104"
>
> So, obviously I thought about this incorrectly. I seem to have a hard
time
> figuring out examples at these sites. Can someone pound something in my
> head on this?
>
> TIA
>
> Susanne Bullo
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list