in reply to using cookies with UserAgent

Try using the cookie jar like this:
use LWP::UserAgent; use HTTP::Cookies; my $WWWAgent = LWP::UserAgent->new(); my $cookies=new HTTP::Cookies(file=>'./cookies.dat',autosave=>1); $WWWAgent->cookie_jar($cookies); ...
with the HTTP::Cookies module. This hooks the cookies onto the LWP::UserAgent. So whatever you do with that LWP::UserAgent from then on will carry those cookies with it.