problem with a looop and with a site



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;
}

.



Relevant Pages

  • Re: update file
    ... Do you really have 'use strict' in your file? ... In general it is usually better to use a while loop instead of a foreach ... You did not declare $bucareli. ...
    (perl.beginners)
  • Re: A better way to add to a hash?
    ... > use warnings; use strict; ... > foreach my $pair{ ... > print Dumper; #yeah, it works, but... ... > Is there a better way to do this than using the "for" loop that way? ...
    (comp.lang.perl.misc)
  • A better way to add to a hash?
    ... use warnings; use strict; ... foreach my $pair{ ... print Dumper; #yeah, it works, but... ... Is there a better way to do this than using the "for" loop that way? ...
    (comp.lang.perl.misc)
  • Re: A better way to add to a hash?
    ... > use warnings; use strict; ... > foreach my $pair{ ... > print Dumper; #yeah, it works, but... ... > Is there a better way to do this than using the "for" loop that way? ...
    (comp.lang.perl.misc)
  • Re: File handle re-use woes using pipe within a loop
    ... >> I'd recommend using strict and lexical file handles, ... If something is lexically scoped within a loop then each time through ... This uses sybolic handle references. ...
    (comp.lang.perl.misc)