Or, if you want the perl for that:
#!/usr/bin/perl
use IO::Dir;
print "Content-type: text/html\n\n";
$d = new IO::Dir "images";
if (defined $d) {
while (defined($_ = $d->read)) {
push(@photos,$_) unless ($_ eq "." || $_ eq "..");
}
print qq(<html><title>Photo Gallery: $_</title>),
qq(<body><img src="images/), $photos[rand(@photos)],
qq("></img></body>);
} else {
print "Can't open images: $!
";
}
What would be ideal, though, would be the ability to resize the picture based on aspect ratio and then have JavaScript format it correctly using "length" and "width" parameters to the img tag.
vastari