SPUG: Template system

Jim Flanagan jimfl at colltech.com
Thu Jul 26 15:14:50 CDT 2001


--Also Sprache Ian Li <ili at cardomain.com> On Thursday, July 26, 2001 12:24 
PM -0700:

     > Right now, I'm considering HTML::Template, Text::Template, Template
     > Toolkit. HTML::Template sounds like a good choice for me, but I
     > can't include files into them. I like Template Toolkit because it
     > works kinda like Server Side Includes, in terms of being able to
     > include other files into one file. But I am concerned about Template
     > Toolkit's speed.

  Actually, there are two ways to include other files using Text::Template.
  Here are a couple of examples:

      <H3> Included File Below</H3>
      {qx{cat filename}}

  and

      <PRE>
      {Text::Template::_load_text('.bashrc')}
      </PRE>

  you can make an alias in the package you use to store variables for the
  template called 'include', then it just looks like:

      {include('my_file')}

  The man page shows how to do this.

  Text::Template seems to have adequate speed in a CGI setting, but my
  applications if Text::Template have been pretty small scale.

--
Jim Flanagan          Collective Technologies
jimfl at colltech.com   http://www.colltech.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list