in reply to reading all images in a directory

Greetings,
I would use HTML::Template to set up a table for image display, 5 per row, as many rows as needed. Something like
<table border="0" cellpadding="4" cellspacing="1" bgcolor="#000000"> <TMPL_LOOP name="rowloop"> <tr bgcolor="#ffffff"> <td valign="top"> <TMPL_IF name="img1src"> <img src="/cgi-bin/thumbnail.pl?img=<TMPL_VAR name="img1src">"> </TMPL_IF> </td> <td valign="top"> <TMPL_IF name="img2src"> <img src="/cgi-bin/thumbnail.pl?img=<TMPL_VAR name="img2src">"> </TMPL_IF> </td> <td valign="top"> <TMPL_IF name="img3src"> <img src="/cgi-bin/thumbnail.pl?img=<TMPL_VAR name="img3src">"> </TMPL_IF> </td> <td valign="top"> <TMPL_IF name="img4src"> <img src="/cgi-bin/thumbnail.pl?img=<TMPL_VAR name="img4src">"> </TMPL_IF> </td> <td valign="top"> <TMPL_IF name="img5src"> <img src="/cgi-bin/thumbnail.pl?img=<TMPL_VAR name="img5src">"> </TMPL_IF> </td> </tr> </TMPL_LOOP> </table>
As for resizing you could create a script that reads in a single image and outputs the resized version, like a thumbnail, You will need GD or Image::Magic for this. Then with your gallery script fill the HTML::Template with image tags that call the thumbnail script i.e. <image src="/cgi-bin/thumbnail.pl?img=foobar.jpg" /> That way you don't have to slurp the entire directory of images in, just their names.

Update Fixed Template formatting for readability

-InjunJoel

"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo