[tpm] WWW::Mechanize and setting cookies

Madison Kelly linux at alteeve.com
Thu Jul 31 21:09:41 PDT 2008


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