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.


In reply to Command Line Output Different from Output to Browser by shockme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.