#!/usr/bin/perl

# Random Link

$linkfile = "links.txt";

open (LINKS, "$linkfile");
srand();
$nlines=@file=<LINKS>;
print "Location: $file[int rand $nlines]\n\n";

close (LINKS);

exit;
Published in: CGI
Download

Related snippets