LWP::UserAgent doesn't appear to set a cookie without a FQDN. Unfortunately, perlmonks.org isn't fully qualified. Use www.perlmonks.org or perlmonks.org. with the trailing dot. (If you look at HTTP::Cookies::add_cookie_header(), you'll see that it expects there to be two dots in the domain name.)