Text::BasicTemplate

Text::BasicTemplate is a simple lexical text/html/etc template parser.
Download

Text::BasicTemplate Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Devin Carraway
  • Publisher web site:
  • http://search.cpan.org/~dcarraway/Text-BasicTemplate-2.006.1/BasicTemplate.pm

Text::BasicTemplate Tags


Text::BasicTemplate Description

Text::BasicTemplate is a simple lexical text/html/etc template parser. Text::BasicTemplate is a simple lexical text/html/etc template parser.SYNOPSIS use Text::BasicTemplate; $bt = Text::BasicTemplate->new; my %dict = ( name => 'John', location => sub { hostname() }, condiments => , sideeffects => { 'Salt' => 'causes high blood pressure', 'Pepper' => 'causes mariachi music', 'Catsup' => 'brings on warner bros. cartoons' }, new => int rand 2 ); $tmpl = "Hello, %name%; your mail is in %$MAIL%. Welcome to %location%!"; print $bt->parse($tmpl,%dict); $tmpl = "%if new%First time, %name%?%fi%". " Care for some %condiments%? ". " They are bad for you. %sideeffects%." $bt->{hash_specifier}->{condiments} = ' '; print $bt->parse($tmpl,%dict);Text::BasicTemplate is a relatively straightforward template parsing module. Its overall function is to permit the separation of format-dependent output from code.This module provides standard key/value substitutions, lexical evaluation/parsing, customizable formatting of perl datatypes, and assorted utility functions.Templates may be structured by the use of arbitrarily nestable if-conditions (including elsif and else), and by the use of subroutine substitutions to provide list parsing. In general, the syntax for conditionals is that of perl itself.Text::BasicTemplate attempts to be as fast and as secure as possible. It may be safely used upon tainted templates and with tainted substitutions without fear of execution of any malicious code. Requirements: · Perl


Text::BasicTemplate Related Software