#!/usr/bin/perl -wT use strict; # Call in img tag - e.g.: my @files = glob("./jpegs/*.jpg"); print "Location: $files[int(rand @files)]\n\n";