<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: perl script getting  http:500 response in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921171#M97087</link>
    <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;This is almost always a scripting erorr, not a network connectivity problem.&lt;BR /&gt;&lt;BR /&gt;Issues I've faced in the past on this:&lt;BR /&gt;1) perl script tries to read a file that is not there, dies.&lt;BR /&gt;2) permissions on a file it needs to read is not correct.&lt;BR /&gt;3) Data format it needs is not what it gets.&lt;BR /&gt;4) Debugging print statements in the program that can be run in production.&lt;BR /&gt;5) Output lines at top of script commented out.&lt;BR /&gt;&lt;BR /&gt;Normally I find the script and at the least get it to run properly at the command line, even if there is no ouput if that doesn't work, I next comment out the output statement redirecting output to http/text and put in write/print statements to figure out what part of the code is bad.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Thu, 04 Jan 2007 22:36:42 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2007-01-04T22:36:42Z</dc:date>
    <item>
      <title>perl script getting  http:500 response</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921170#M97086</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;I have written a perl script to post http message to a server and I am getting a response of 500 - Internal Server Error. There are no problem posting to other server so I am thinking if it is a problem with their server or simply a connectivity issue. What do you think?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry</description>
      <pubDate>Thu, 04 Jan 2007 22:11:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921170#M97086</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2007-01-04T22:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: perl script getting  http:500 response</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921171#M97087</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;This is almost always a scripting erorr, not a network connectivity problem.&lt;BR /&gt;&lt;BR /&gt;Issues I've faced in the past on this:&lt;BR /&gt;1) perl script tries to read a file that is not there, dies.&lt;BR /&gt;2) permissions on a file it needs to read is not correct.&lt;BR /&gt;3) Data format it needs is not what it gets.&lt;BR /&gt;4) Debugging print statements in the program that can be run in production.&lt;BR /&gt;5) Output lines at top of script commented out.&lt;BR /&gt;&lt;BR /&gt;Normally I find the script and at the least get it to run properly at the command line, even if there is no ouput if that doesn't work, I next comment out the output statement redirecting output to http/text and put in write/print statements to figure out what part of the code is bad.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 04 Jan 2007 22:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921171#M97087</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-01-04T22:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: perl script getting  http:500 response</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921172#M97088</link>
      <description>&lt;!--!*#--&gt;Hi Henry,&lt;BR /&gt; &lt;BR /&gt;as SEP suspects, this most likely seems to be a scripting error.&lt;BR /&gt;Usually the 500 HTTP RC is owed to a malformed HTTP server response header.&lt;BR /&gt;To avoid this it is recommended practise to rather rely on well established standard CGI modules like CGI.pm than doing the HTTP formatting, parsing and encoding by some self tinkered routine (unless you know the HTT protocol intimately and have well justified needs).&lt;BR /&gt;This is what the average HTTP response header should look like:&lt;BR /&gt;&lt;BR /&gt;$ perl -MCGI=header -le 'print header'       &lt;BR /&gt;Content-Type: text/html; charset=ISO-8859-1&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;Please, note that the HTTP header requires a CR/NL  separator, which can be seen when dumped: &lt;BR /&gt; &lt;BR /&gt;$ perl -MCGI=header -le 'print header'|od -c &lt;BR /&gt;0000000   C   o   n   t   e   n   t   -   T   y   p   e   :       t   e&lt;BR /&gt;0000020   x   t   /   h   t   m   l   ;       c   h   a   r   s   e   t&lt;BR /&gt;0000040   =   I   S   O   -   8   8   5   9   -   1  \r  \n  \r  \n  \n&lt;BR /&gt;0000060&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;But if, as you say, you are using the same Perl CGI script successfully on another server where you don't receive the 500 RC,&lt;BR /&gt;it probably isn't a header problem.&lt;BR /&gt; &lt;BR /&gt;To find out what really causes the 500 you need to inspect that webserver's error.log for possible hints in the error message.&lt;BR /&gt;An alternative would be (just for debugging purposes) to dump the error messages wrapped up in HTML to your browser by inserting this import in your Perl CGI script on that webserver:&lt;BR /&gt; &lt;BR /&gt;use CGI::Carp qw(fatalsToBrowser);&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jan 2007 04:04:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-getting-http-500-response/m-p/3921172#M97088</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-01-05T04:04:43Z</dc:date>
    </item>
  </channel>
</rss>

