in reply to TT to process a string
#!/perl/bin/perl use strict; use warnings; use Template; my $template = Template->new(); my $str = "some [% foo.bar %] stuff\n"; $template->process(\$str, { foo => { bar => 'cool' }, }) or warn $template->error; __END__ some cool stuff
Maybe you shouldn't use the same string for both input and output (that appends the result to the template, at least in my tests).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TT to process a string
by Cagao (Monk) on May 25, 2008 at 17:00 UTC | |
by Cagao (Monk) on May 25, 2008 at 17:07 UTC |