#!/usr/bin/perl -w # fetch use strict; use File::Basename; use DBI; use LWP::Simple qw(mirror); my $RDF_DIR = './rdf'; my $dbh = DBI->connect("dbi:mysql:book", "user", "password"); my $sth = $dbh->prepare(qq{select URL from rdf}); $sth->execute or die $DBI::errstr; while (my $url = $sth->fetchrow) { my $name = basename($url); mirror($url, "$RDF_DIR/$name"); } $dbh->disconnect;