From robert.l.harris at gmail.com Tue Nov 11 19:34:35 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Wed, 12 Nov 2014 03:34:35 +0000 Subject: [Denver-pm] perl cgi-bin and Content Type? Message-ID: I have a simple perl script which is supposed to run as a CGI to create some html output. The start of the output looks like : Content-Type: text/html; charset=ISO-8859-1 . . . I use 2 print statements. print "Content-Type: text/html; charset=ISO-8859-1\n\n"; print "\n"; What I've noticed is that if I don't put the two carriage returns I get a 500 error. If I put the two carriage returns I get output but it's not processing the stylesheet information which follows. Anyone have any ideas or a POST example perl script which uses stylesheets I can pick apart? Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From three18ti at gmail.com Tue Nov 11 19:39:35 2014 From: three18ti at gmail.com (Jon) Date: Tue, 11 Nov 2014 20:39:35 -0700 Subject: [Denver-pm] perl cgi-bin and Content Type? In-Reply-To: References: Message-ID: Hey Robert, LONG time since I last wrote a CGI script. Shouldn't it be \r\n in the doctype declaration? print "Content-Type: text/html; charset=ISO-8859-1\r\n"; I could be wrong, but I have vague flashbacks of the doctype causing me horrible headaches.... Again, I could be way off, but you can call me names after you try it ;) Best Regards, Jon A On Nov 11, 2014 7:34 PM, "Robert L. Harris" wrote: > > I have a simple perl script which is supposed to run as a CGI to create > some html output. The start of the output looks like : > > Content-Type: text/html; charset=ISO-8859-1 > > > . > . > . > > I use 2 print statements. > > print "Content-Type: text/html; charset=ISO-8859-1\n\n"; > print "\n"; > > What I've noticed is that if I don't put the two carriage returns I get a > 500 error. If I put the two carriage returns I get output but it's not > processing the stylesheet information which follows. Anyone have any ideas > or a POST example perl script which uses stylesheets I can pick apart? > > Robert > > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From larryl at emailplus.org Tue Nov 11 20:32:54 2014 From: larryl at emailplus.org (Larry Leszczynski) Date: Tue, 11 Nov 2014 21:32:54 -0700 Subject: [Denver-pm] perl cgi-bin and Content Type? In-Reply-To: References: Message-ID: <1415766774.2476706.189949661.74FAAB01@webmail.messagingengine.com> Hi Robert - The HTTP spec says that lines should end with CR LF, and that you need a blank line after the last header and before the body. So your first example with two carriage returns is correct (except you should probably use "\r\n\r\n" instead of "\n\n"). There must be something else going on that is causing trouble with the style sheet info - can you post a more complete example? Larry On Tue, Nov 11, 2014, at 08:34 PM, Robert L. Harris wrote: > I have a simple perl script which is supposed to run as a CGI to create > some html output. The start of the output looks like : > > Content-Type: text/html; charset=ISO-8859-1 > > > . > . > . > > I use 2 print statements. > > print "Content-Type: text/html; charset=ISO-8859-1\n\n"; > print "\n"; > > What I've noticed is that if I don't put the two carriage returns I get a > 500 error. If I put the two carriage returns I get output but it's not > processing the stylesheet information which follows. Anyone have any > ideas > or a POST example perl script which uses stylesheets I can pick apart? > > Robert > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm From robert.l.harris at gmail.com Wed Nov 12 04:35:22 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Wed, 12 Nov 2014 12:35:22 +0000 Subject: [Denver-pm] perl cgi-bin and Content Type? References: <1415766774.2476706.189949661.74FAAB01@webmail.messagingengine.com> Message-ID: Bingo, that did it. Thank you! On Tue, Nov 11, 2014, 21:33 Larry Leszczynski wrote: > Hi Robert - > > The HTTP spec says that lines should end with CR LF, and that you need a > blank line after the last header and before the body. So your first > example with two carriage returns is correct (except you should probably > use "\r\n\r\n" instead of "\n\n"). There must be something else going > on that is causing trouble with the style sheet info - can you post a > more complete example? > > Larry > > On Tue, Nov 11, 2014, at 08:34 PM, Robert L. Harris wrote: > > I have a simple perl script which is supposed to run as a CGI to create > > some html output. The start of the output looks like : > > > > Content-Type: text/html; charset=ISO-8859-1 > > > > > > . > > . > > . > > > > I use 2 print statements. > > > > print "Content-Type: text/html; charset=ISO-8859-1\n\n"; > > print "\n"; > > > > What I've noticed is that if I don't put the two carriage returns I get a > > 500 error. If I put the two carriage returns I get output but it's not > > processing the stylesheet information which follows. Anyone have any > > ideas > > or a POST example perl script which uses stylesheets I can pick apart? > > > > Robert > > _______________________________________________ > > Denver-pm mailing list > > Denver-pm at pm.org > > http://mail.pm.org/mailman/listinfo/denver-pm > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: