[tpm] WWW::Mechanize and setting cookies

Zoffix Znet zoffix at zoffix.com
Fri Aug 1 02:53:15 PDT 2008

Well {cookie_jar} is not defined when you call a method on it later on.

As for "debuging", I just said that if you see "use base qw/Foo Bar/;"
than make sure you check out Foo and Bar modules for the methods which
you are looking for, same goes for "our @ISA = qw/Foo Bar/;"

On Fri, 2008-08-01 at 00:09 -0400, Madison Kelly wrote:
> Zoffix Znet wrote:
> > Yes, that won't work, because WWW::Mechanize doesn't actually set
> > {cookie_jar} element in its blessed hashref. Take a look at Mech's
> sub
> > new {}..
> > 
> > Now why it doesn't error out, as you've said, with " Can't call
> method
> > "set_cookie" on an undefined value at LINE" with your code below I
> don't
> > really understand.. but anyway.. use ->cookie_jar method to obtain
> the
> > HTTP::Cookies object and always check the "use base" or @ISA
> assignments
> > when you can't find the documented method in the code ^_^
> > 
> > Cheers.
> I think it didn't error out because 'cookie_jar' is a hash key in the 
> blessed 'self', which '$agent' is a reference to.

> I have to claim ignorance now; how would I use 'use base' or check the 
> @ISA assignments to debug? I understand that these control the order of 
> method lookups...
> Madi

More information about the toronto-pm mailing list