HTML::Template
am 24.10.2007 06:50:31 von ankur
Hi
I am new to perl. I am using HTML::Template module to display tmpl
files on the web server. But I need to use HTML::Template::Expr module
now as well, to display the values of certain expressions in the same
script.
How can I use both HTML::Template and HTML::Template::Expr module in
the same perl and template file.
I mean I need to use both the following things in the script :
Kindly help.
Ankur Jain
http://ankurjain.org
Re: HTML::Template
am 24.10.2007 08:30:06 von Ron Bergin
On Oct 23, 9:50 pm, Ankur wrote:
> Hi
>
> I am new to perl. I am using HTML::Template module to display tmpl
> files on the web server. But I need to use HTML::Template::Expr module
> now as well, to display the values of certain expressions in the same
> script.
>
> How can I use both HTML::Template and HTML::Template::Expr module in
> the same perl and template file.
>
> I mean I need to use both the following things in the script :
>
>
>
>
>
Why would you need to want to do that? That type of expression would
be best done in the script instead of the template.
>
>
>
> Kindly help.
>
> Ankur Jainhttp://ankurjain.org
This is a more appropriate example usage.
#!/usr/bin/perl
use warnings;
use strict;
use HTML::Template::Expr;
print "Content-type: text/html\n\n";
my $template = HTML::Template::Expr->new(filename => 'example.tmpl');
$template->param(var1 => 'this is var1');
$template->param(banana_count => 30);
print $template->output();
==========
testing
I have too many bannas
tmpl_if>
Re: HTML::Template
am 24.10.2007 11:36:52 von ankur
On Oct 24, 11:30 am, Ron Bergin wrote:
> On Oct 23, 9:50 pm, Ankur wrote:
>
> > Hi
>
> > I am new to perl. I am using HTML::Template module to display tmpl
> > files on the web server. But I need to use HTML::Template::Expr module
> > now as well, to display the values of certain expressions in the same
> > script.
>
> > How can I use both HTML::Template and HTML::Template::Expr module in
> > the same perl and template file.
>
> > I mean I need to use both the following things in the script :
>
> >
>
> >
> >
>
> Why would you need to want to do that? That type of expression would
> be best done in the script instead of the template.
>
>
>
> >
>
> > Kindly help.
>
> > Ankur Jainhttp://ankurjain.org
>
> This is a more appropriate example usage.
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
> use HTML::Template::Expr;
>
> print "Content-type: text/html\n\n";
>
> my $template = HTML::Template::Expr->new(filename => 'example.tmpl');
> $template->param(var1 => 'this is var1');
> $template->param(banana_count => 30);
>
> print $template->output();
>
> ==========
>
>
>
> testing
>
>
>
>
> I have too many bannas
> tmpl_if>
>
>
Tbanks, it solved my problem.
Re: HTML::Template
am 25.10.2007 12:38:35 von Ted Zlatanov
On Tue, 23 Oct 2007 21:50:31 -0700 Ankur wrote:
A> I am new to perl. I am using HTML::Template module to display tmpl
A> files on the web server. But I need to use HTML::Template::Expr module
A> now as well, to display the values of certain expressions in the same
A> script.
A> How can I use both HTML::Template and HTML::Template::Expr module in
A> the same perl and template file.
My suggestion is to try the Template Toolkit (module "Template" on
CPAN). You may like it better than HTML::Template; I do after many
years of using both. It does everything HTML::Template can do AFAIK.
Ted