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

#12 Printing Debugging Information

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.

The Code

 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 ...
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