Click here to get back home

perl html template error

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
perl html template error joe 03-11-2008
Posted by joe on March 11, 2008, 10:24 am
Please log in for more thread options
Hello, I am lerning the html template module and I keep get an error
on this line

$template->param(HEADINGS=>\@headings);


HTML::Template->output() : fatal error in loop output :
HTML::Template : Attempt to set nonexistent parameter 'heading' - this
parameter name doesn't match any declarations in the template file :
(die_on_bad_params => 1) at /usr/lib/perl5/site_perl/5.8.0/HTML/
Template.pm line 2997
at ./one.cgi line 60

It looks like HEADINGS is not part of html::template any ideas on
which module has setting? or is it obsolete?

Posted by sheinrich on March 11, 2008, 11:03 am
Please log in for more thread options
> Hello, I am lerning the html template module and I keep get an error
> on this line
>
> $template->param(HEADINGS=>\@headings);
>
> HTML::Template->output() : fatal error in loop output :
> HTML::Template : Attempt to set nonexistent parameter 'heading' - this
> parameter name doesn't match any declarations in the template file :
> (die_on_bad_params => 1) at /usr/lib/perl5/site_perl/5.8.0/HTML/
> Template.pm line 2997
> at ./one.cgi line 60
>
> It looks like HEADINGS is not part of html::template any ideas on
> which module has setting? or is it obsolete?

You should give us a clue on how you build the content of @headings
and what your template placeholders look like.

The error suggests that your template might have a loop placeholder of
name HEADING (here you are defining HEADINGS instead) or one of the
field names is declared HEADING and this key might be missing from the
records (hash references) inside @headings.

steffen


Posted by J. Gleixner on March 11, 2008, 11:09 am
Please log in for more thread options
joe wrote:
> Hello, I am lerning the html template module and I keep get an error
> on this line
>
> $template->param(HEADINGS=>\@headings);
>
>
> HTML::Template->output() : fatal error in loop output :
> HTML::Template : Attempt to set nonexistent parameter 'heading' - this
> parameter name doesn't match any declarations in the template file :
> (die_on_bad_params => 1) at /usr/lib/perl5/site_perl/5.8.0/HTML/
> Template.pm line 2997
> at ./one.cgi line 60
>
> It looks like HEADINGS is not part of html::template any ideas on
> which module has setting? or is it obsolete?

HTML::Template

Why do you think there is a default variable of HEADINGS?

You have to defined it in your template.

The error is saying that you have a template variable 'heading',
that you're not setting. You can either set it to '', or read
the documentation to learn how to use 'die_on_bad_params'.

Posted by joe on March 13, 2008, 6:07 am
Please log in for more thread options
Thanks, Makes sense. I was going over the tutorial and the template
did not have HEADINGS anywhere.
On Mar 11, 11:09 am, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> joe wrote:
> > Hello, I am lerning the html template module and I keep get an error
> > on this line
>
> > $template->param(HEADINGS=>\@headings);
>
> > HTML::Template->output() : fatal error in loop output :
> > HTML::Template : Attempt to set nonexistent parameter 'heading' - this
> > parameter name doesn't match any declarations in the template file :
> > (die_on_bad_params => 1) at /usr/lib/perl5/site_perl/5.8.0/HTML/
> > Template.pm line 2997
> > at ./one.cgi line 60
>
> > It looks like HEADINGS is not part of html::template any ideas on
> > which module has setting? or is it obsolete?
>
> HTML::Template
>
> Why do you think there is a default variable of HEADINGS?
>
> You have to defined it in your template.
>
> The error is saying that you have a template variable 'heading',
> that you're not setting. You can either set it to '', or read
> the documentation to learn how to use 'die_on_bad_params'.


Similar ThreadsPosted
HTML::template Module in perl April 6, 2007, 7:26 am
HTML::Template module in perl April 9, 2007, 4:29 am
perl 5.8.8 with Template::Cache error March 28, 2007, 4:52 pm
HTML::Template October 24, 2007, 12:50 am
Dreamweaver (or some such) and HTML::Template? March 7, 2005, 9:38 am
Converting my index.pl(cgi) to html::template one April 26, 2005, 7:03 pm
Framework help: Can HTML::Template do this? If not, what CPAN module can? September 8, 2005, 1:02 pm
modperl: HTML::Template not working inside handler February 25, 2008, 2:33 pm
converting games.pl(cgi.pm) => games.pl (html::template) April 28, 2005, 12:31 am
Loops with loops using html-template January 12, 2006, 2:25 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap