Re[2]: [htmltmpl] New Template Object based on Existing one
Brought to you by:
samtregar
From: <hat...@tu...> - 2004-02-09 15:24:26
|
Hello Chris, Monday, February 9, 2004, 5:11:34 PM, you wrote: >> It's even simpler: simply associate the first object with the second. >> #!/usr/bin/perl >> use HTML::Template; >> my $tmpl = new HTML::Template filehandle => \*DATA; >> $tmpl->param(foo => "bar"); >> print $tmpl->output; >> my $str = "Second template: foo = <TMPL_VAR NAME=foo>\n"; >> my $copy = new HTML::Template scalarref => \$str, associate => $tmpl; >> print $copy->output; I think that this can be done more simply: my $copy = new HTML::Template associate => $tmpl; but if I'm not mistaken, when you will call $tmpl->param(foo => 'bar') later, you'll get this param also in $copy -- Best regards, Ãîðüêèé Þðèé mailto:hat...@tu... |