in reply to reading all images in a directory

Why not use Image::Magick (specifically the composite method to build a single large image) or GD ?

Also note that "resizing" using HTML is generally not the best way -- it's better to physically resize the image. For example, if your image is 500k at 800x600 and you have <img src="..." width="200" height="150">, yes it will be displayed at 200x150 (though it's up to the browser to scale it properly w/o making it look bad), but the client still has to pull down the 500k image as opposed to maybe 25k if it were physically resized to 200x150.

As for the HTML table, HTML::Table might be what you need to save the trouble of writing the loops yourself.