#!/usr/bin/perl -- use LWP::Simple qw/ get mirror $ua /; $ua->show_progress(1); my $html = get( q{http://www.oracle.com/technetwork/database/berkeleydb/downloads/} ); if( my( $current ) = $html =~ m{href=\x22http[^\x22]+?/([^/]+md5)\x22}i ){ print "$current\n"; die "UHOH " if $current =~ /[^a-zA-Z0-9\.\-]/; mirror( "http://download.oracle.com/berkeley-db/$current", $current ); $current =~ s/\.md5$//i; mirror( "http://download.oracle.com/berkeley-db/$current", $current ); } __END__ ** GET http://www.oracle.com/technetwork/database/berkeleydb/downloads/ ==> 301 Moved Permanently ** GET http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html ==> 200 OK (1s) db-5.2.36.tar.gz.md5 ** GET http://download.oracle.com/berkeley-db/db-5.2.36.tar.gz.md5 ==> 304 Not Modified ** GET http://download.oracle.com/berkeley-db/db-5.2.36.tar.gz ==> 304 Not Modified