#!/usr/bin/perl -w
use strict;
for (1..273) {
`wget http://www.my-site.com/mydir/?Page=$_`;
}
Note: this code is untested, and is missing any sort of error checking and assumes you're using a UNIX like system with the wget command installed. Not much of a solution.
Do not trust this code, but you get the idea.
A better way would be to have a look at the modules and utilities in Bundle::LWP and base a more robust script on those.
Implementation is left as a task for the reader.
Update: Beaten to it by moodster! :-)
Great minds think alike. ;)
Further update: I feel quite honored to have merlyn's attention :-)
I posted the incorrect/dirty/horrific snippet as a basis of one solution, LWP::Simple is clearly a better solution - and I made a point of mentioning Bundle::LWP, which includes the mirror functionality that merlyn has demostrated.
So, ignoring the obvious benefits of LWP::Simple,
I have seen the error of my ways with the use of backticks here - system() should have been used instead of backticks to fork wget.
That method still isn't fanstatic - I stand by my disclaimer :-)
|