HTML::Template::PerlInterface

HTML::Template::PerlInterface is a Perl interface of HTML::Template::Pro.
Download

HTML::Template::PerlInterface Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Sam Tregar
  • Publisher web site:
  • http://search.cpan.org/~wonko/CGI-Application-MailPage-1.6/lib/CGI/Application/MailPage.pm

HTML::Template::PerlInterface Tags


HTML::Template::PerlInterface Description

HTML::Template::PerlInterface is a Perl interface of HTML::Template::Pro. HTML::Template::PerlInterface is a Perl interface of HTML::Template::Pro.SYNOPSISThis help is only on perl interface of HTML::Template::Pro. For syntax of html template files you should see "SYNOPSIS" in HTML::Template::SYNTAX.First you make a template - this is just a normal HTML file with a few extra tags, the simplest being < TMPL_VAR >For example, test.tmpl: < html > < head >< title >Test Template< /title > < body > My Home Directory is < TMPL_VAR NAME=HOME > < p > My Path is set to < TMPL_VAR NAME=PATH > < /body > < /html >See HTML::Template::SYNTAX for their syntax.Now create a small CGI program: #!/usr/bin/perl -w use HTML::Template::Pro; # open the html template my $template = HTML::Template::Pro->new( filename => 'test.tmpl', case_sensitive=> 1); # fill in some parameters $template->param(HOME => $ENV{HOME}); $template->param(PATH => $ENV{PATH}); # send the obligatory Content-Type and print the template output print "Content-Type: text/htmlnn"; $template->output(print_to=>*STDOUT);If all is well in the universe this should show something like this in your browser when visiting the CGI: My Home Directory is /home/some/directory My Path is set to /bin;/usr/binIt is recommended to use case_sensitive=>1 in new() and print_to=>*STDOUT in output() for best perfomance.IMPORTANT NOTE: you can safely write my $template = HTML::Template->new( ... options ...) or even my $template = HTML::Template::Expr->new( ... options ...)with HTML::Template::Pro, because in absence of original HTML::Template and HTML::Template::Expr HTML::Template::Pro intercepts their calls.You can also use all three modules and safely mix their calls (benchmarking may be the only reason for it). In case you want to mix calls to HTML::Template::Expr and HTML::Template::Pro, the only proper usage of their load isuse HTML::Template; use HTML::Template::Expr; use HTML::Template::Pro;Of course, if you don't plan to mix them (in most cases) it is enough to simply writeuse HTML::Template::Pro;Simply use HTML::Template::Pro, it supports all functions of HTML::Template::Expr. Requirements: · Perl


HTML::Template::PerlInterface Related Software