The specific problem you're facing is that perl's
opendir only works on local directories, and the more general one is that HTTP doesn't provide any standard way to get a listing of files in the directory. You will have to either parse the Web page (using something like
HTML::TreeBuilder), or else access the remote directory with a different protocol (like FTP with
Net:FTP, WebDAV with
HTTP::DAV, or ssh with
File::Remote).