You could just use WWW::Mechanize (it uses LWP::Simple underneath) to login properly .. it could also be that the server is bouncing you based on your browser, in which case you can fudge the user agent string.
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
# OR:
use WWW::Mechanize;
my $mech = WWW::Mechanize->new( agent=>"wonderbot 1.01" );