#!/usr/local/bin/perl -w use strict; $| = 1; # Directory to find images in my($dir) = "/web/i-scream/htdocs/logos"; # Pattern to match images - remember to escape my($pattern) = "\\.jpg\$"; # Where the setbg command is my($setbg) = "/web/i-scream/bin/setbg.pl"; # Code... print "Content-type: image/jpeg\n\n"; exec "$setbg -r -p \'$pattern\' -b cat -f \' \' $dir";