On Jan 7, [EMAIL PROTECTED] said:

>1) Created an HTML template file which contains HTML code (of course) and
>the names of variables that are populated in my script.  For example, if
>the following line is in my template file:
>
><td>Hello $name</td>
>
>Then somewhere in my perl script, you will find:
>
>my $name = "Ian";

The variable in your template file must be uppercase, so it must be $NAME.
The variable in your program can be named whatever you want -- the
connection will be seen in a moment.

>2) Included the following in the perl script:
>
>CGI::FastTemplate->set_root("/where/my/templates/are");
>$tpl->define( main   => "filename.tpl");

Add here:

  $tpl->assign(NAME => $name);

That will cause "$NAME" to be replaced with $name's value in your
template.

>$tpl->parse( PAGE  => "main");
>$tpl->print(PAGE);

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to