HTMLTMPL FAQ
What is it for?
How do I install it?
How do I use it?
How do I make forms and listboxes?
Where can I get the latest version?
What about setting cookies?
I keep getting an error saying that the template cannot be found when I run it via the web server. It works ok when I run it from the command line though?
I get an error stating that the token was not found.
Is there a charge for using this module?
Where do I report bugs, requests for new features, etc?
Is there a mailing list?
What is it for?
It is intended to break the task of outputing html tags from the cgi. This
frees the cgi to concentrate on getting hold of data from a database, file, etc.
A template of html is used instead which means that this can be created and
maintained using standard web page tools (Frontpage, Hot Metal, etc).
How do I install it?
Copy HTMLTMPL.pm to a standard perl include directory (use perl -V to find
out where these are on your installation).
How do I use it?
Please see the examples.
Where can I get the latest version?
http://freeweb.ftech.net/bilstone/downloads.html
What about setting cookies?
The 'output' function can be given a variable number of strings. Each of these
will be output before the parsed html, and with a blank line seperator. These
therefore are the http headers (where the set-cookie:...) would go.
eg:
$www = new CGI;
$cookie = $www->cookie(-name=>'userid',
-value=>'freddy',
-path=>'/',
-domain=>'.bilstone.co.uk');
$tmpl = new HTMLTMPL;
$tmpl->src('mainmenu.html');
$tmpl->output("Set-cookie: $cookie;", "Content-type: text/html");
I get an error stating that the token was not found.
The parser scans the template specified in the call to 'src(...)' and builds
an internal list of tokens found. This list can be displayed by calling the
'dumpAll(...)' function at any point after the 'src(...)' call;
There is an example of this in the
examples section.
To dump just the contents of a block rather than all the tokens in the page,
specify the name of the block to the 'dumpAll(...)' call.
I keep getting an error saying that the template cannot be found when I run it via the web server. It works ok when I run it from the command line though?
The call to 'src(...)' must specify the full pathname to the template file. When it is used via the web server the current directory will be different to the
one used from the command line call.
Is there a charge for using this module?
No. But if you let me know you are using it I would appreciate it. :-)
Where do I report bugs, requests for new features, etc?
To the author (ian@bilstone.co.uk).
Is there a mailing list?
Yes, it can be found at https://www.bilstone.co.uk/cgi-bin/mailman/listinfo/htmltmpl
Ian Steel. (ian@bilstone.co.uk)
April 1999