which is just unbelievably good at doing that sort of thing, with the only down-side being that it's a shell tool and not a Perl module. It has a lot of functionality that can be engaged with just a command-line switch, something that you'd have to write for yourself in Perl using most of the modules I'm familiar with.
If all you need to do is download images, that's the program to use. It might even be advantageous to make Perl generate the list for it to download, and then let it take care of the gory details.