# build POST request my $req = HTTP::Request->new('POST', $postURL); # $postURL is "http://everything2.org/index.pl" $req->content_type('application/x-www-form-urlencoded'); $req->content($postData); # $postData is "op=login&username=FOO&password=BAR" or somesuch # get the page my $response = $ua->request($req); if ($response->is_success) { # extract the cookie from the response and return the HTTP::Cookies object $loginCookieJar->extract_cookies($response); $loginCookieJar; } else { die "Could not log in.\n"; }