Re: [htmltmpl] using __DATA__ section as template in module
Brought to you by:
samtregar
From: Carl F. <C.A...@du...> - 2004-10-04 08:25:32
|
>>> <gr...@sp...> 02/10/2004 23:41:36 >>> > >Anyone ideas on what is going on? Any suggestions welcome. > >Thanks in advance, >-Ken Hi Ken, Try this instead (below), noticed that I pass the DATA fileglob (*DATA) directly to HTML::Template->new Carl #!/usr/bin/perl use strict; use warnings; Foo->run(); package Foo; use HTML::Template; sub run{ my $template = HTML::Template->new(filehandle => *DATA, die_on_bad_params=>1, strict=>1); $template->param(VALUE=>'xx'); print $template->output; } 1; __DATA__ <html> <head> </head> <body> <TMPL_VAR NAME=VALUE> </body> </html> [ken@darkstar DBWebForm]$ ./Foo.pm <html> <head> </head> <body> xx </body> </html> |