#16 Guest Book

The visitor counter keeps track of people automatically. Another way to handle this is to ask them to voluntarily record their name for you. The guest book script lets people record their name and email address so you can contact them later.

The Code

 1 #!/usr/bin/perl -T 2 use strict; 3 use warnings; 4 5 use CGI; 6 use CGI::Carp qw(fatalsToBrowser); 7 use HTML::Entities; 8 9 # 10 # Configure this for your system 11 # 12 # Where the information is collected 13 my $visit_file = "/tmp/visit.list"; 14 15 my $query = new CGI; # The cgi query 16 17 # The name of the user 18 my $user = $query->param("user"); 19 20 # The email of the user 21 my $email = $query->param("email"); 22 23 if (not defined($user)) { 24 $user = ""; 25 } 26 ...

Get Wicked Cool Perl Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.