in reply to noshow by file extension

I think glob would do a lot of the work for you here, as would CGI.pm. Example:

use CGI qw(:html4); chdir "$ENV{'DOCUMENT_ROOT'}/foo"; my @toshow = grep {-f} # filter to only regular files glob('*.{png,jpg,html}'); print map { a({ -style => q(Color: #000000; font-size: 13px;), -href => "/foo/$_" }, $_ ) } @toshow;
I use that map because the file name is repeated in href and text. You may need to chdir or tune the file names to make the urls come out right. I have "/foo" tacked on to illustrate.

After Compline,
Zaxo