taizica has asked for the wisdom of the Perl Monks concerning the following question:

Hello:

I would appreciate if you could share some tricks with the use of Text::Template.

1)In the text file to be processed, how can we ignore sentences in the file which we treat as "comments" and do not want to show them up in the converted version of the file?

2)Can we set up more than 1 delimiters in one single call of the fill_in? For example, (% %) for perl variable definitions and (# #) for perl functions etc.

Thanks in advance.

Tai
  • Comment on Text::Template->How to use comments and delimiters

Replies are listed 'Best First'.
Re: Text::Template->How to use comments and delimiters
by Anonymous Monk on Jan 27, 2004 at 21:28 UTC
    When using Text::Template...
    1. Before adding Perl Code, escape all { and } with a Perl script.
    2. All the Perl code goes between { and }
    3. end all Perl code I want to evaluate to nothing with '';
    4. If my HTML, ActionScript and JavaScript is happy happy, and my Perl between the {} is happy happy, Text::Template always seems happy happy.
    5. One of my favorite modules by far. Not sure I would even use alot of Perl if it didn't have text::Template.
Re: Text::Template->How to use comments and delimiters
by Anonymous Monk on Jan 27, 2004 at 22:36 UTC
    1) preprocess

    2) Manual says no