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

    HTML::Template::HTX 0.07

    Download button

    No screenshots available
    Downloads: 178  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Theo Niessink | More programs
    Perl Artistic License / FREE
    August 30th, 2010, 03:47 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    HTML::Template::HTX description

    Handle HTML Extension template (.htx) files

    The HTML::Template::HTX module reads and outputs HTML Extension template (.htx) files, which enable you to seperate your Perl code from HTML code.

    To use a .htx template file in your Perl script, basically follow these steps:

     1. Create a new HTML::Template::HTX object.
     2. Optionally define some parameters, and output the header of the template.
     3. Optionally change or define some parameters, and output the detail section. This step is optionally repeated a number of times, depending on the data you're processing.
     4. Optionally change or define some parameters, and output the footer of the template.
     5. Close the template file, or destroy the HTML::Template::HTX object.

    If you don't have any repeated data, then you can skip steps 2 and 3, and just use print_footer to output the whole template file at once. If you have multiple sets of repeated data, then you should probably follow a slightly altered schema (see the detail_section method).

    SYNOPSIS

     use HTML::Template::HTX;

     $htx = HTML::Template::HTX->new('template.htx') or die "Oops!";

     $htx->param('counter' => 0);
     $htx->print_header(1);

     foreach(qw(I used to care but Things Have Changed)) {
     $htx->param(
     'counter' => $htx->param('counter')+1,
     'Name' => $_,
     );
     $htx->print_detail;
     }

     $htx->print_footer;
     $htx->close;


    template.htx

     < HTML >< HEAD >< TITLE >Sample results< /TITLE >

     < /HEAD >< BODY >

     < H2 >Sample results:< /H2 >

     < ¾gindetail% >
     < %counter% >. < %Name% >< BR >
     < %enddetail% >

     < /BODY >< /HTML >



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    htx handler | HTML template | Perl module | HTML | htx | template

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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