I am trying to write a program in perl to download images from a website. The problem is I would like to retain the same directory structure as the website it is being downloaded from.
e.g. If the image to be download is from the below url. Then the program should create the directory name “folder” and inside that download and then put the image inside the inner most folder.
http://www.example.com/folder/download/images.jpg
I am using LWP to download the images.
use LWP::Simple;
getstore($fileURL,$filename);
Look at wget or pavuk. You can also call them from within perl. That’s what I usually do.