title: How can use Threads in Requesting Perl
body: <p>I'm posting this simple script :
  1 open a text file with multiple URLs for a site.
  2 The first line gets the address of the site and makes the request.
  3 content is verified on the condition.
  Threads want to add this script to make faster, but do not know how to do. Please someone could help me in Threads ?</p>
  
  <pre><code>    #!/usr/bin/perl
  use LWP::UserAgent;
  use HTTP::Request;
  use LWP::Simple;
  
  $sis="$^O";if ($sis eq linux){ $cmd="clear";} else { $cmd="cls"; }
  system("$cmd");
  
  if (!$ARGV[0]) {
  
  $sis="$^O";if ($sis eq linux){ $cmd="clear";} else { $cmd="cls"; }
  system("$cmd");
  
  print q {
  [+] Request.....
  
  };
  
  open( SITE, "&lt; $ARGV[0]" ) or die( "No open: $!" );
  
  our @array = &lt;LINES&gt;;
  
  $numbers = $#array;
  
  for ($i = 0; $i &lt;= $numebers; $i++) {
  
  $url = "$array[$i]";
  
  my $req=HTTP::Request-&gt;new(GET=&gt;$url);
  my $ua=LWP::UserAgent-&gt;new();
  $ua-&gt;timeout(15);
  my $resposta=$ua-&gt;request($req);
  
  if($resposta-&gt;content =~ /Exist/) {
  
  print "n t $url n";
  
  open (NOTEPAD, "&gt;&gt; texto.txt");
  print NOTEPAD "$url";
  close(NOTEPAD);
  
  }
  }
  
  print q {
  
  [+] FIM !
  };
  </code></pre>