Skip to Main Content
Wicked Cool Perl Scripts
book

Wicked Cool Perl Scripts

by Steve Oualline
February 2006
Intermediate to advanced content levelIntermediate to advanced
304 pages
6h 16m
English
No Starch Press
Content preview from Wicked Cool Perl Scripts

#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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Debugged

Perl Debugged

Peter Scott, Ed Wright
Perl & LWP

Perl & LWP

Sean M. Burke
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 1593270623Catalog PageErrata