Saturday, November 1, 2008

grab a few pdf files on web

#!/usr/bin/perl -w
use strict;

open (IN, "list");
my @data=;
my @out= map { local $_ =$_; s/(.*href=\")(.*)(\".*)/$2/; $_} @data;

my @out1;
my $pref='http://ocw.mit.edu';

foreach my $example (@out) {
my $out=$pref.$example;
push(@out1,$out);
}

foreach my $stuff (@out1) {
#print "$stuff \n";
system("wget $stuff");
}