Coding Domain

Perl: Coding Domain Modules


Downloads
Perl Modules
Description
With these modules, writing large CGI programs, or console applications in Perl is even less difficult. Most of my CGI programs use them aswell. The features include script location detection, e-mailing, template parsing, ASCII convertions. You're allowed to use the modules aswell, but not to abuse them. Details about that are discussed in the provided readme file.

Coding Domain Perl Modules
Version:
Author: Diederik van der Boor
Date:
Requirements: o For CGI Scripts: A webserver (personal or remotely hosted)
o For CGI Scripts: CGI support; Server has to allow/be able to run *personal* CGI programs.
o Perl 5.005 installed for processing scripts.
o Perl modules: Fcntl.
o Optional E-mail functionality: sendmail (UNIX mostly) or the Net::SMTP module (Win32 mostly).
o Some brains ;-)

Features:

Module Documentation
These documentations are also includes in the module files aswell. This is simply the online version of it.
CGI::ErrorTrapDisplay advanced error messages
CGI::LocationCGI Location Detection
CGI::TemplateEasy to use template parser
File::PlainIOSimple object interface for file input and output
HTML::EscapeASCIIConverts special ASCII characters to HTML escape codes
INet::MailerE-mails a message via SMTP
Test::InputTests for input validation
Test::IPAddressTests for IP addresses and blocks
Time::TextConverting epoch time into a normal format
Time::ZonesConverting GMT to different timezones

How to install
This is discussed in detail in the provided readme file. Here is a sort summary.

How to use the modules for your scripts
You may implement these modules in your programs. How you can do that, is fully described in the modules themself, and the documentation is also available online. Type perldoc module name at a terminal window, E.g. perldoc CGI::Location.

Please don't change the names for the modules. You're allowed to use them, not abuse them. If any bugs show up, let me know. Don't re-distrubute new versions of the modules yourself.

Here is a sort sample in Perl:

#!/usr/bin/perl -w

use strict;
use CGI qw(:cgi);

use CGI::Location;
use CGI::ErrorTrap;
use CGI::Template;
use HTML::EscapeASCII;

my $Copyright = "Copyright © 2001 Diederik van der Boor";
FormatFieldHTML( $Copyright ); # Converts © to © pretty useless here

TemplateLoad('template.html') or die "Can't load template: $!";
TemplateSetReplace('COPYRIGHT' => $Copyright);


print header('text/html');
print_TemplateUntil('TITLE' => 'Using the Coding Domain Perl Modules');
print_TemplateUntilLabel('BODY');


# The variables used here are added by the Location module
print "Current URL is: $THIS_URL";
print "Website home page is: $THIS_SITE/index.html";


print_TemplateUntilEOF();
exit;