#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use HTML::Template;
use DBI;
# database connection code
my $template;
my $newtemplate;
my $minitemplate;
my $query = new CGI;
my $sth;
$template = HTML::Template->new(
filename => "template.tmpl"
);
# this line would contain the prepare for a SELECT statement that
would return the mini-template we would be using.
$sth->execute();
$newtemplate = $sth->fetch;
$minitemplate = HTML::Template->new(
arrayref => $newtemplate
);
$minitemplate->param(test => "toost");
$template->param(content => $minitemplate->output);
print $query->header();
print $template->output;
12.17.2005
HTML::Template and MySQL/DBI
12.16.2005
queryString.cgi
#!/usr/bin/perl -w
=head1 NAME
queryString.cgi - test script for using just the query string.
By using this method instead of the arg=param method,
it is easier to hide what we are doing.
=cut
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
my $query = new CGI;
my $article;
$article = $ENV{QUERY_STRING};
print $query->header;
print $article;
12.06.2005
time.cgi
#!/usr/bin/perl -w
=head1 NAME
time.cgi - basic test, for time-limit related stuff
=cut
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
my %TIME;
my $minDif;
my $dif;
=over
=item DESCRIPTION
Essentially, this is a test script. It uses the C
Subscribe to:
Posts (Atom)