#!/usr/bin/perl -wT use strict; use CGI ':standard'; print "Content-type:text/html\n\n"; use lib '/home/jesskilb/perlmods/share/perl/5.8.4'; use lib '/home/jesskilb/perlmods/lib/perl/5.8.4'; use File::Random qw/:all/; my $dir = '/home/jesskilb/the-spam-oracle.com'; my $file = random_file(-dir => "$dir/infinity"); my @lines = random_line("$dir/infinity/$file", int(rand(3)) + 1); my $randomlines=join(" ",@lines); open(OUTPUT,"$dir/results_template.html") or die "Can't open file\n"; my $line; while ($line=) { $line=~s/results go here/$randomlines/; print $line; } close OUTPUT;