The small code segment below will get the contents of a web page using a
perl script. The site I want to access wants a cookie sent as well.
There is a cookie for this site is in my ~/.netscape/cookies file. How
do I change the code below so I can fake pass the cookie along with the
POST request?
Will I need to modify the format of what is in ~/.netscape/cookies?
------------------------------
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
my $URL = 'http://www.yahoo.com';
my $ua = LWP::UserAgent->new;
my $response = $ua->request(POST "$URL");
if ($response->is_success) {
print $response->content;
} else {
print "Bad luck this time\n";
}
Thanks!
-Brian