#!/usr/bin/perl use strict; # Loads the CGI Module use CGI; # creates a new CGI object my $page = new CGI; # Grab a named CGI parameter my $value = $page->param("Comic"); ##########declare the names of the files for the loop my @Comm = ('Images/Le_Comic.jpg', 'Images/Le_Comic2.jpg', 'Images/Le_Comic3.jpg', 'Images/Le_Comic4.jpg', 'Images/Le_Comic5.jpg', 'Images/Le_Comic6.jpg', 'Images/Le_Comic7.jpg', 'Images/Le_Comic8.jpg', 'Images/Le_Comic9.jpg', 'Images/Le_Comic10.jpg', 'Images/Le_Comic11.jpg', 'Images/Le_Comic12.jpg', 'Images/Thanksgiving_Comic.jpg'); ########## #Open up the comments file open (FILE, '../Comment.txt') or die "The file could not be opened.\n"; #Save the contents of the FILE handle to an array my @Comment = ; #Close the FILE close(FILE); my ('$i','$Como','$Number'); #do a "for" loop to make it choose the quote for ($i=0; $i<=@Comment; $i++) { #Do an "if" loop to go through and save the right quote if ($value eq $Comm[$i]) { $Como = $Comment[$i]; #Save the number of the quote to a variable for the title $Number = $i + 1; } } ## Then: # This will print a standard HTML header print $page->header; print "\n"; print < Animetion Station > Webcomic > Comic #$Number ENDMETA print "\n"; print <
Web Comics


$Como

ENDHTML print "\n";