You should probably read up on LWP and DBI, and there's probably a google API that you can use for searching (I haven't done any spidering using a search engine). I learned how to do this sort of thing from O'Reilly's "Spidering Hacks" book, which probably has enough examples that you can cobble something together. You can probably also find enough on the web as well, but it will be more disjoint.
Ideally there will be a few databases that have the PDFs (various journal article databases) and you can either use APIs that they have, or figure out how to screen scrape it. It probably won't be trivial, but you'll learn a lot of perl on the way.