Path: usenet.cise.ufl.edu!huron.eel.ufl.edu!usenet.eel.ufl.edu!uky.edu!stdio!209.155.56.21.MISMATCH!pln-e!extra.newsguy.com!lotsanews.com!nntprelay.mathworks.com!ais.net!newsfeed.wli.net!hammer.uoregon.edu!nntp.teleport.com!news.teleport.com!not-for-mail
From: [email protected] (Ken Williams)
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules
Subject: ANNOUNCE: Text::FillIn.pm (new)
Followup-To: comp.lang.perl.modules
Date: 31 Mar 1998 23:34:27 GMT
Organization: The Math Forum
Lines: 51
Sender: [email protected]
Approved: [email protected] (comp.lang.perl.announce)
Message-ID: <[email protected]>
NNTP-Posting-Host: gadget.cscaper.com
X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content.
Xref: usenet.cise.ufl.edu comp.lang.perl.announce:35 comp.lang.perl.modules:714

Hi,

I've just uploaded a new module, Text::FillIn.pm version 0.01, to CPAN.
It is a class for implementing fill-in text templates.  It is designed to
be flexible and sub-classible.  It can handle tags inside other tags.

SYNOPSIS

  use Text::FillIn;

  $template = new Text::FillIn('some text with [[$vars]] and [[&routines]]');
  $filled_in = $template->interpret();  # Returns filled-in template

  $template->interpret_and_print();  # Prints template to currently
                                     # selected filehandle, streaming output

  # Set parsing options:
  $Text::FillIn::HOOK{'$'} = sub { return ${$_[0]} };  # Hard reference
  $Text::FillIn::HOOK{'&'} = "main::run_function";     # Symbolic reference
  sub run_function { return &{$_[0]} }

  # Nested templates
  $template = new Text::FillIn();
  $template->set_text('the text is [[ $[[$var1]][[$var2]] ]]');
  $var1 = 'two_';
  $var2 = 'parter';
  $two_parter = 'interpreted';
  $template->interpret_and_print();  # Prints "the text is interpreted"


  $template = new Text::FillIn();
  $template->get_file('/etc/template_dir/my_template');  # Fetches a file


  $template = new Text::FillIn();
  @Text::FillIn::TEMPLATE_PATH =
     ('.', '/etc/template_dir');  # Where to find templates
  $template->get_file('my_template'); # Gets ./my_template or
                                      # /etc/template_dir/my_template


For more specific information, please see the documentation inside
FillIn.pm, by doing "pod2txt FillIn.pm", or "perldoc Text::FillIn" once
you've installed the module.

>
>   file: $CPAN/authors/id/KWILLIAMS/Text-FillIn-0.01.tar.gz
>   size: 11921 bytes
>    md5: fcd15d853783f34959fb8a89e068f5d7