in reply to How to get the cookie

The easy way is to use WWW::Mechanize, which will handle extracting the cookies from a response and sending them with a request for you. Otherwise, you can do what WWW::Mechanize does, by using the ->extract method of HTTP::Cookies.