in reply to Error using HTML::Template
I see two errors - one is an error in your code (copy/paste from improperly formatted POD on your end), the other is an actual typo in the POD.
Looking at the POD on CPAN, the line reads:
# send the obligatory Content-Type and print the template output print "Content-Type: text/html\n\n", $template->output;
So it's "print", not "output print". But there is a typo in the POD - that comma before $template->output; should be a period (string concatenation).
print "Content-Type: text/html\n\n". $template->output;
Or, if you're familiar with C, you could also write it in a more recognizable form:
print sprintf("Content-Type:text/html\n\n%s",$template->output);
No difference, really, but sometimes people find it easier to read the latter.
Update: Ok, so I'm wrong about the second bug - I'll plead ignorance to printing in LIST form. That being said, based on the original post, I think a code copy &paste went badly, and that's why you're getting the strange error messages.
PS - and yes, you could just use printf, but you'll get far more use out of sprintf in the long run. :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Error using HTML::Template
by !1 (Hermit) on Dec 11, 2003 at 15:33 UTC | |
Re: Re: Error using HTML::Template
by ctilmes (Vicar) on Dec 11, 2003 at 15:41 UTC | |
Re: Re: Error using HTML::Template
by Anneq (Vicar) on Dec 11, 2003 at 19:54 UTC |