use HTTP::Request::Common qw(GET POST); use HTTP::Cookies; use LWP::UserAgent; ... my $ua = new LWP::UserAgent(); my $cookies = new HTTP::Cookies(file => 'cookies.dat', autosave => 1); $ua->cookie_jar($cookies); # We now have a persistent cookie jar associated with the # user agent. my $req = GET "$url"; # if the response included a cookie, it'll be saved in the # jar, and resent along with subsequent GETs or POSTs to # the same domain that issued the cookie.