#!/usr/bin/perl -w # Copyright: Judita Preiss # Date of creation: 6 April 2009 # This program is designed to download some given web pages $DIR = "download/"; (-e $DIR) or die "You need to create a directory called \"download\"\n"; $BASE = "http://www.fox.com/house/recaps/s5_e"; sub download_all_episodes(){ my ($i, $in, $out, $pad); for($i = 1; $i < 20; $i++){ if($i < 10){ $i = sprintf("%02s", $i); } $in = $BASE . $i . ".htm"; $out = $DIR . "s5_" . $i; `curl $in > $out`; ($? == 0) or die "Couldn't retrieve $in\n"; } } download_all_episodes();