Re: problem with a looop and with a site



alex123x@xxxxxxxxx wrote:
Hello all,
The program runs a loop and each time it sends a signal to the site and
checks whether its ok or not and then it creates a file with the name
of the good port
but the program doesnt work and i dont know what to do, plz help me

use strict;
use LWP::Simple;

my $i=1;
my ($site);
open (FH,">c:/portss.txt") or die "Ahhh";
while ($i<10000) {
$site = get("http\:\/\/connect.majestyc
.net\/\?t=$i\&u=80");
open (FH,">c:/portss.txt");
print (FH $site,"\n");
foreach (<FH>) {
if ($_=~m/Connected OK/i){
open (ST,">C:/Downloads/$1.txt");
}}
$i=$i+1;
}

this is NOT the way to write a port scanner; you have a LOT of reading
to do.

also, look into what characters actually need delimiting in a double
quoted string.

-jp

.