#!/usr/bin/perl
#c11ex5.cgi - displays a Web page containing the user's
#name and the book information
use CGI qw(:standard);
#prevent Perl from creating undeclared variables
use strict;
#declare variables
my ($count, $C_name);
if (!cookie('Count')){
print "Hello";
}
#assign input to variable
#$count = cookie('Count');
#$count = $count + 1;
#create cookie
$C_name = cookie(-name => "Count",
-value => "$count",
-expires => "6M");
#send cookie to browser
#create Web page
print "\n";
print "Jubilee Book Club\n";
print "\n";
print "Hello! \n";
print "You have been here $cookie('count') times.\n";
print "\n";
|