Sorry I can't help more now but usually I would try to determine what line was killing the program by inserting print statements at different points in it.

If the program runs correctly from the command line then you probably have some trouble with the CGI environment, which could be file permissions of the program or the file you are reading, or perhaps misconfiguration of the web server. You could also be missing the CGI module.

If I were you I would put a print "Content-type: text/html\n\nTEST"; at the very top before your use statement. If you still have this error your permissions, or perhaps using ".pl" when your server wants ".cgi", or your perl path (try which perl at the unix command line) or something else outside your program is the problem. That print statement will also let you see if the header command is working.

One thing for sure, if you are only testing your program by running it from a browser, and the use statement fails, you will never be able to figure out what is going on without printing the header manually first. The minimum program is much smaller than what you have, just the first couple lines I would say.


In reply to Re: same 500 server error problem shorter question by mattr
in thread same 500 server error problem shorter question by Anonymous Monk

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.