Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Text::BasicTemplate 2.006.1

    Download button

    No screenshots available
    Downloads: 313  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.6/5)
    3 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Devin Carraway | More programs
    Perl Artistic License / FREE
    November 5th, 2007, 23:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Text::BasicTemplate description

    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 => [ 'Salt', 'Pepper', 'Catsup' ],
    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.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    template parser | HTML parser | Perl module | lexical | html | template

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM