For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > September 2004 > HTML::Template is choking









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML::Template is choking
Rick Triplett

2004-09-28, 3:55 pm

HTML::Template is choking with the complaint ...

HTML::Template->new() : Syntax error in <TMPL_*> tag at /XXX[here I'm
ommiting the path]XXXX/data/templates/student_info.tmpl : 13. at
/usr/local/lib/perl5/site_perl/5.005/HTML/Template.pm line 2243.

This is a typical line from my template ...
<input type="text" name="name_full" value="<TMPL_VAR
NAME="name_full">" size="40" maxlength="40"></div>

This isn't much code to look at, but I'm hoping my blunder will be
obvious to someone with more experience. The nested quotes in my
attempt to put TMPL_VARs into the value field make me suspicious that I
am misusing HTML::Template. Anyone have some words of wisdom for me?
Rick T.

Rob Hanson

2004-09-28, 8:55 pm

> The nested quotes in my attempt to put TMPL_VARs
> into the value field make me suspicious that I
> am misusing HTML::Template


It may look odd, but the nested quotes are fine.

If I had to guess I would say it is because there is a newline within the
tag (as it seems to be in your example). I tried it on my installation and
*did not* get an error. I am running version 2.7.

Looking at the change log this was something that was added in version 2.3.
So if you are running anything older than 2.3 it may be time for an upgrade.

[From: http://search.cpan.org/src/SAMTREGA...ate-2.7/Changes]
2.3 Thu June 28 12:00:00 2001
- New Feature: template tags can now span lines. (Roland Giersig)

Rob

-----Original Message-----
From: Rick Triplett [mailto:rick_2003@reason.net]
Sent: Tuesday, September 28, 2004 2:39 PM
To: beginners-cgi@perl.org
Subject: HTML::Template is choking


HTML::Template is choking with the complaint ...

HTML::Template->new() : Syntax error in <TMPL_*> tag at /XXX[here I'm
ommiting the path]XXXX/data/templates/student_info.tmpl : 13. at
/usr/local/lib/perl5/site_perl/5.005/HTML/Template.pm line 2243.

This is a typical line from my template ...

<input type="text" name="name_full" value="<TMPL_VAR
NAME="name_full">" size="40" maxlength="40"></div>

This isn't much code to look at, but I'm hoping my blunder will be
obvious to someone with more experience. The nested quotes in my
attempt to put TMPL_VARs into the value field make me suspicious that I
am misusing HTML::Template. Anyone have some words of wisdom for me?
Rick T.


--
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com