February 2006
Intermediate to advanced
304 pages
6h 16m
English
CGI programming requires different skills. Not only do you have to know Perl programming, but also HTML and HTML forms. Sometimes what's in the form and what you think is in the form differ. As a result, the inputs to your CGI program aren't what it expects and the program fails.
To help locate errors, it's nice to know the exact inputs to a program. This shows the use of a debug function that prints out all the CGI and environment parameters, giving the programmer a lot of extremely useful debugging information.
1 #!/usr/bin/perl -T 2 use strict; 3 4 use CGI::Thin; 5 use CGI::Carp qw(fatalsToBrowser); 6 use HTML::Entities; 7 8 # 9 # debug -- print debugging information to the screen 10 # 11 sub ...