in reply to itterator variable in a LWP-UA-code snippet
If I understand your question correctly, the easiest way to do it is to make the $url a separate variable, instead as part of the GET. Also, I don't know what you are try to accomplish if you don't want the content. Are you just tring to detect whether the server is up? There are easier ways to do that.
for my $i (0..10000) { my $url = sprintf("http://dms-schule.bildung.hessen.de/suchen/suche_ +schul_db.html?show_school=5503,%d", $i); my $request = HTTP::Request->new(GET => $url ); $request->header('Accept' => 'text/html'); my $response = $ua->request($request); if ($response->is_success) { $pagecontent = $response -> content; } my $request = POST $url, # check the outcome if ($res->is_success) { print "Success $url \n"; # print out all the URLS that were +fetched! } else { print "Error: $url " . $res->status_line . "\n"; } } # end of for $i loop
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Duplicate: please delete Re: iitterator variable in a LWP-UA-code snippet
by Gavin (Archbishop) on Oct 31, 2010 at 16:27 UTC | |
by zentara (Cardinal) on Oct 31, 2010 at 21:54 UTC | |
|
Re: Duplicate: please delete Re: iitterator variable in a LWP-UA-code snippet
by Perlbeginner1 (Scribe) on Oct 31, 2010 at 12:38 UTC | |
by marto (Cardinal) on Oct 31, 2010 at 13:26 UTC | |
|