I'm looking into making a program that would open a batch of HTML files, find all the image tags, calculate the size of the images (in pixels) and insert the correct width="" and height="" values. I am using Image::Size for getting the actual sizes, but here's where I'm stuck: How do I get the filename from the HTML? I could probably "roll-my-own", but I've been told that I should probably ask first before I do something like that. Has anyone else here done something of this sort? Can you guys give me any suggestions/idea? They would be greatly appreciated. Thanks!