in reply to REGEX: muliple search and replace
Use the following CGI script:<HTML> <HEAD><TITLE>Test Template</TITLE> <BODY> <H1><TMPL_VAR NAME=something></h1> <!--<TMPL_VAR NAME=var1>--> This is a lame Web page <!--<TMPL_VAR NAME=var2>--> </BODY> </HTML>
You'll see that the HTML comments have been filled in quite nicely. Read the documentation of this module and you'll see how very useful it can be.#!c:\perl\bin\perl.exe -wT use strict; use HTML::Template; use CGI qw/:standard/; # open the html template my $template = HTML::Template->new(filename => 'template.tmpl'); # fill in some parameters $template->param( something => "Test", var1 => "Some Comment", var2 => "Another comment" ); print header, $template->output;
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|