First, drop everything and go read jeffa's tutorial on HTML::Template. But the HTML should look something like this (untested model code):
But that's a LOT of work. If all you want to do is print a text file to a screen, then just crank up CGI.pm, and print the contents (untested model code):<HTML> <HEAD> <TITLE> <TMPL_VAR NAME=Title> </title> </head> <BODY> Here's the text from the .txt file<br> <TMPL_LOOP NAME=Text> <TMPL_VAR NAME=Line><br> </TMPL_LOOP> </body> </html>
No need to use HTML::Template to do all that work.use strict; use CGI qw(:standard); print header; print start_html('My Text File'); open (TEXTFILE, "my_text_file") or die "Cannot open text file: $!"; while (<TEXTFILE>) { chomp; print $_, p; } close (TEXTFILE) or die "Cannot close file: $!"; print end_html;
----Asim, known to some as Woodrow.
In reply to Re: About HTML::Template
by Asim
in thread About HTML::Template
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |