Gossamer Forum
Home : Products : DBMan : Installation :

Error in html.pl -- can't find

Quote Reply
Error in html.pl -- can't find
I've tried very hard to correct this error. I'm sure I'm missing something obvious, but I guess it's a case of not being able to find one's own mistake.

I was attempting to display the URL of the current page (which I have used SSI other places to do but of course cannot do in html.pl). I have yet to figure out how to do that, but in trying I have messed up something else.

The error message I get is

Error Message : fatal error: Undefined subroutine &main::html_print_headers called at ./html.pl line 106.

A text copy of my file is at http://www.ebr.lib.la.us/html_pl.txt.

If someone can see the error -- probably a missied ' or something -- I'd appreciate it.


Quote Reply
Re: [ebm76] Error in html.pl -- can't find In reply to
Download (if you don't already have one) a text-editor such as TextPad that will let you view line numbers. This will help a lot in the future.

The error is "undefined subroutine" and it is referring to &html_print_headers. This means the subroutine is either missing, broken, name is spelled wrong, syntax error, etc.

I think the problem may be the print delimiter that doesn't seem to have a corresponding mate.

sub html_print_headers {
# --------------------------------------------------------
# Print out the headers if they haven't already been printed.

if (!$html_headers_printed) {
print "Content-type: text/html\n\n";
$html_headers_printed = 1;

Try deleting the part in red and see what happens. Good Luck!

Ps: I think that bit "|;" belongs in the subroutine just above the &html_print_headers.

Notice that you have print "qq|" and then the part about "...maintained by Baton Rouge..." but then no closing "|;"

Last edited by:

Watts: Jun 11, 2002, 2:20 PM
Quote Reply
Re: [Watts] Error in html.pl -- can't find In reply to
Thanks Watts!

You helped me a lot; I found my errors and corrected them...I know I have a working database, even if it's not exactly what I want as of yet :))