mwalstra has asked for the wisdom of the Perl Monks concerning the following question:
#!/local/bin/perl -w require LWP; use LWP::Simple; use LWP::UserAgent; use HTTP::Cookies; my $browser = LWP::UserAgent->new(); $cookie_jar = HTTP::Cookies->new('file' => 'C:/Documents and Settings/ +user/Cookies/user@kingsofchaos[2].txt', # where to read/write cookies 'autosave' => 1, # save it to disk when done ); $browser->cookie_jar( $cookie_jar ); $xml = "usrname=data&uemail=data&peeword=data"; $url = "http://www.somesite.com/login.php?$xml"; $reply_msg = $browser->get($url); while (($key,$value) = each(%$reply_msg)) { print "$key - $value\n"; while(($nkey,$nvalue) = each(%$value)) { print "$key - $nkey - $nvalue\n"; # while(($nnkey,$nnvalue) = each(%$nvalue)) # { # print "$key - $nkey - $nnkey - $nnvalue\n"; # } } } exit;
edit: holli added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Cookies
by inman (Curate) on Sep 08, 2005 at 11:35 UTC |