I'm not very good at Perl but I'm sure it could be done. Assuming you're using Linux and have wget installed I'd do something like this.
#!/usr/bin/perl
$site = "www..."; # sets site into variable
`wget $site` # downloads site and saves in current directory as index.html
* # I'm not sure how to do this but you'll have to save the contents of index.html into an array.
`rm index.html` # removes index.html so you don't fill up your directory.
OK, if you can find out how to get a file into an array this should work. I'm still learning Perl myself and I think it's a great language. Good luck!