srand; $index = rand(0..10); print "$quotes[$index]"; ---------- srand; @rquotes = rand(@quotes); print "$rquotes[3]"; #### #!/usr/bin/perl -w use strict; srand; my $quotes_file = '../quotes/quotes.txt'; open (QFILE, "<$quotes_file") || die "Error: could not open $quotes_file:$!\n"; my @quotes = ; my $quote = $quotes[rand(@quotes)]; print "Content-Type: text/html\n\n"; print "$quote";