$forum_login = ""; $forum_type = "number"; # either NUMBER or NAME depending if specific form will be found by name or number $forum_call = "1"; #form number or name for login $forum_user ="username"; #NAME of the forum field for username $forum_pass = "passwrd"; #NAME of the forum field for username $username = ""; # username to signing $password = ""; # password to signin $forum_fail = "incorrect"; # text to find if login failed # # above empty variables are emptied for obvious reasons # in this sample source code use LWP::Simple; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new); $mech->get( $forum_login ); if ($forum_type eq "number") { $mech->submit_form( form_number => $forum_call, fields => { $forum_user => $username, $forum_pass => $password, } ); print "Good!"; } else { $mech->submit_form( form_name => $forum_call, fields => { $forum_user => $username, $forum_pass => $password, } ); print "Good!"; } print $mech->content; # comes back empty exit; . . ####################### # Was sign in successful? ####################### if ($mech->content =~ m/$forum_fail/i || $mech->content eq "") { my $time = localtime(); open(LOG, ">> error.txt") or die "Error: $!"; print LOG $time; print LOG $mech->response; print LOG "\n"; close(LOG) or die "Error: $!"; print $mech->content; print "ERROR:" . $mech->response; } else { print "LOGGED IN!"; }