in reply to Re: Mirroring Script
in thread Mirroring Script
The dirtiest way to do this is:Ouch! You're not kidding. Using backquotes in a void context! Not only is it messy because it forks needlessly (thanks to the question mark), but you're also capturing the output just to discard it!#!/usr/bin/perl -w use strict; for (1..273) { `wget http://www.my-site.com/mydir/?Page=$_`; }
Here's code that will be much saner and faster. In fact, you can run it multiple times, and it downloads only the changed files, if "if-modified-since" is supported by the server:
use LWP::Simple qw(mirror); for (1..273) { mirror "http://www.my-site.com/mydir/?Page=$_", "file$_"; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Mirroring Script
by BazB (Priest) on Feb 05, 2002 at 16:51 UTC |