my $mech = WWW::Mechanize->new( cookie_jar => { file => "/path/to/cookies.txt", autosave => 1 } );