http://qs321.pair.com?node_id=154295

shockme has asked for the wisdom of the Perl Monks concerning the following question:

I'm about 95% certain I've seen the answer to this somewhere in the Monastery. Either my skills at using Super Search have greatly declined, or I dreamed it.

I have a script (which will eventually be CGI). When I execute it from the command line, the output is:

<HTML> <HEAD> <TITLE>test page</TITLE> <STYLE TYPE="text/css"> BODY {background: white;} H2.std-header {color: white; background-color: #006699;} H5.std-header {color: white; background-color: #006699;} P.std-title {color: #006699; background-color: #CCCCCC;} A {color: #006699;} A.header {color: #FFFFFF} EM {color: #006699;} KBD {font-family: serif; color: #006699;} PRE.code {color: #006699;} STRONG {color: #006699;} </STYLE> </HEAD> <BODY> <CENTER> <H2 CLASS="std-header">test page <H5 CLASS="std-header"> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"><TR> <TD WIDTH="20%"><A HREF="/shock/index.php" CLASS="header">Main</A></TD +> <TD WIDTH="20%"><A HREF="/" CLASS="header">Music</A></TD> <TD WIDTH="20%"><A HREF="/shock/linux/index.php" CLASS="header">Linux< +/A></TD> <TD WIDTH="20%"><A HREF="/shock/perl/index.php" CLASS="header">Perl</A +></TD> <TD WIDTH="20%"><A HREF="/family/index.php" CLASS="header">Family</A>< +/TD> <TD WIDTH="20%"><A HREF="/shock/links.php" CLASS="header">Links</A></T +D> </TR></TABLE> </H5> </H2> </CENTER> Test #1<br>2002-03-25<br>Various<br> This is a test. It might someday +have something interesting. <H2 CLASS="std-header"> <H5 CLASS="std-header"> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"><TR> <TD WIDTH="20%"><A HREF="/shock/index.php" CLASS="header">Main</A></TD +> <TD WIDTH="20%"><A HREF="/" CLASS="header">Music</A></TD> <TD WIDTH="20%"><A HREF="/shock/linux/index.php" CLASS="header">Linux< +/A></TD> <TD WIDTH="20%"><A HREF="/shock/perl/index.php" CLASS="header">Perl</A +></TD> <TD WIDTH="20%"><A HREF="/family/index.php" CLASS="header">Family</A>< +/TD> <TD WIDTH="20%"><A HREF="/shock/links.php" CLASS="header">Links</A></T +D> </TR></TABLE> </H5> Test Page </H2> </CENTER> </BODY> </HTML>
This displays perfectly - exactly as I was hoping it would appear. However, when I execute this same script through my browser, only the following appears:
Test #1<br>2002-03-25<br>Various<br> This is a test. It might someday +have something interesting.
Nothing else is printed to the browser. The script which produces this is:
#!/usr/bin/perl -w use strict; use exitwound::BuildLink qw(&buildLinks); my ($NodeTitle, $NodeDate, $NodeSection, @words) = buildLinks(1); ######################## # BEGIN STANDARD HEADERS ######################## require("HEADER01.pl"); require("standard.css.pl"); require("HEADER02.pl"); require("shock-header-links.pl"); require("HEADER03.pl"); ######################## # END STANDARD HEADERS ######################## print "$NodeTitle<br>"; print "$NodeDate<br>"; print "$NodeSection<br>"; print @words; # print "test page"; ######################## # BEGIN STANDARD FOOTERS ######################## require("FOOTER01.pl"); require("shock-footer-links.pl"); require("FOOTER02.pl"); ######################## # END STANDARD FOOTERS ########################
Each of the require statements calls a script which produces the appropriate output. Again, from the command line, I get what I'm expecting, but from the browser, I only get the information contained within the print statements. It's as though, when called as a CGI script, the print statements within the require'd scripts are being routed to some place other than STDOUT.

I think I must be missing something obvious, but missing it nonetheless. As always, any advice is most welcome.

Thanks.

If things get any worse, I'll have to ask you to stop helping me.