The second regular expression below looks wrong to me (lwp 5.64):
sub set_cookie
{
[...]
# path and key can not be empty (key can't start with '$')
return $self if !defined($path) || $path !~ m,^/, ||
!defined($key) || $key !~ m,[^\$],;
^^^^^^
If the comment is correct, then the if statement tests for the wrong
thing: the second regexp should be just =~ /^\$/, without the square
brackets or the !~. ATM, it will only complain if $key consists
*solely* of '$' characters, which doesn't make any sense.
BTW, I've ported Cookie.pm to Python, so if anybody else here is / was
writing / porting something similar, or knows of an existing Python
client cookie module, please say so (no, the Python standard library
cookie module doesn't deal with the client end). It's here (poorly
tested as yet, but it passes all the relevant LWP tests):
http://wwwsearch.sourceforge.net/README-ClientCookie
http://wwwsearch.sourceforge.net/LWPy.tar.gz
John