http://qs321.pair.com?node_id=933735


in reply to Cookies, JavaScript and User Agent Problems

You are creating $ua, but LWP:Simple already has a $ua. You need to import $ua instead of creating your own, since yours will not get used by LWP::Simple.
use LWP::Simple qw( $ua getstore ); # ... $ua->cookie_jar( HTTP::Cookies->new( file => $cookie_path, autosave => 1 ) );
This is documented in LWP::Simple, but only by a single line of text, with no example.