#!/usr/bin/perl
use warnings;
use strict;
# open and slurp file.
open(FILE, "; close(FILE);
# get random entry.
my $rand = rand( scalar @records );
#chop records
chop($records[$rand]);
# now, split the entry.
my ($image, $year, $location, $title) = split(/\,/, $records[$rand]);
# open the SSI.
open(SSI, ">/full/path/to/include/file/rand_image.html")
or die "The file could not be opened (fatal): $!.\n";
print SSI <