stuck in a while loop
- From: "Nospam" <nospam@xxxxxxxx>
- Date: Fri, 30 Jun 2006 02:59:51 GMT
Can anyone identify what is wrong with code, or worse how to fix it?, it
worked one time, but not anymore, I have hardly made any changes
#! perl\bin\perl
use strict;
use warnings;
use Data::Dumper;
use WWW::Mechanize;
use LWP::Useragent;
open (FILE2, "text1.txt") or die "couldn't open $!";
use constant START => "<FILE2>";
while()
{
my $mech = WWW::Mechanize->new( );
my @url;
my $START = <FILE2>;
print "$START \n";
(my $varia1 = $START) =~ s/\@.*//;
print "$varia1 \n";
$mech->get('http://www.loginurl');
$mech->form(1);
$mech->field('login',"$varia1");
if ($mech->success){ print "login successfully set \n";} else{print $!;}
$mech->submit();
if ($mech->success){ print "login successfully submitted \n";} else{print
$!;}
$mech->follow_link( text_regex => qr/Daily news/i);
if ($mech->success){ print "link successfully followed \n";} else{print
$!;}
my ($content3) = $mech->content() =~ /= "(.*)r"/;
my @content1 = $content3;
foreach my $content2 (@content1) {
open (FILE, ">> hm5.txt");
print $content2."\n";
print FILE $content2."\n";
last;
}
}
close FILE2;
close FILE;
.
- Follow-Ups:
- Re: stuck in a while loop
- From: Tad McClellan
- Re: stuck in a while loop
- From: Dr.Ruud
- Re: stuck in a while loop
- From: Brian Wakem
- Re: stuck in a while loop
- From: anno4000
- Re: stuck in a while loop
- Prev by Date: Re: providig a filename as an argument fom the command line
- Next by Date: Re: providig a filename as an argument fom the command line
- Previous by thread: providig a filename as an argument fom the command line
- Next by thread: Re: stuck in a while loop
- Index(es):