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 > Libraries

    Template::FAQ 2.19

    Download button

    No screenshots available
    Downloads: 325  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Andy Wardley | More programs
    Perl Artistic License / FREE
    August 16th, 2007, 10:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Template::FAQ description

    Template::FAQ contains Frequently Asked Questions about the Template Toolkit.

    Template::FAQ contains Frequently Asked Questions about the Template Toolkit.

    Template Toolkit Language

    Why doesn't [% a = b IF c %] work as expected?

    Because the parser interprets it as

    [% a = (b IF c) %]

    Do this instead:

    [% SET a = b IF c %]

    If I'm using TT to write out a TT template, is there a good way to escape [% and %]?

    You can do this:

    [% stag = "[%"
    etag = "%]"
    %]

    and then:

    [% stag; 'hello'; etag %]

    Or something like:

    [% TAGS [- -] %]
    [- INCLUDE foo -] # is a directive
    [% INCLUDE foo %] # not a directive, just plain text, passed through

    How do I iterate over a hash?

    This is covered in the Template::Manual::VMethods section of the manual page. A list of all the keys that are in the hash can be obtained with the 'keys' virtual method. You can then iterate over that list and by looking up each key in turn get the value.

    [% FOREACH key = product.keys %]
    [% key %] => [% product.$key %]
    [% END %]

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Template Toolkit | Frequently Asked Questions | Perl module | Template | Toolkit | FAQ

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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