If you're new to this kind of thing, I can strongly recommend the book Spidering Hacks, by Hemenway and Calishain. It is an O'Reilly book and therefore can be ordered from Amazon. It has several examples that use modules such as LWP::UserAgent andWWW::Mechanize.