********** July 18th random2.cgi PERL code ********** #!/usr/bin/perl use CGI qw(:standard); @quotes = ("quote1.txt","quote2.txt","quote3.txt","quote4.html","quote5.txt", "quote6.html","quote7.txt","quote8.html","quote9.html"); $n = @quotes; $quoteList = param('quoteNumbers'); $quoteList =~ tr/ //d; param('quoteNumbers', "$quoteList"); @quoteList = split /,/, $quoteList; print "Content-type: text/html\n\n"; print "\n\n\n"; print start_form, "Enter a comma separated list - legal values are 1 through $n", br, textfield('quoteNumbers'), p, submit('See the quotes'), end_form; foreach (@quoteList) { print "\n", p, "", p, "\n"; open(FILE, $quotes[$_ - 1]); while () { print $_; } close FILE; } print "\n"; print "\n";