This looks like a newbie question but I've been using other methods of this class for 10 years without seeing this problem, so I don't know what's going wrong.
I have HTTP::Cookies version 6.01 installed, perl 5.16.3, CentOS 7.1. When I try to call the get_cookies() function:
perl -e 'use HTTP::Cookies; $x = new HTTP::Cookies; $x->get_cookies("foo.com");'
I get:
Can't locate object method "get_cookies" via package "HTTP::Cookies" at -e line 1.
But the HTTP::Cookies documentation clearly says it's a member method:
http://search.cpan.org/~oalders/HTTP-Cookies-6.04/lib/HTTP/Cookies.pm
$cookie_jar->get_cookies( $url_or_domain )
Calling it on a new instance, I would expect it to return undef, not to give an error message that this is not a member method of the class.
Now, that's the documentation for version 6.04 and I am using 6.01. But it seems hard to believe that such a basic function like get_cookies() would have been missing from version 6.01. Am I doing something wrong?
I can call the as_string() method (which does work) and parse it for the cookie that I'm looking for, but I would still like to know why get_cookies() isn't working.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.