I don't immedetly see your problem on a first readthrough, while tried. I agree with fglock about printing your HTTP header as early as possible. Since the header information actualy changes for you depending on processing, that's fairly late, so just stick a Content-Type: text/plain in temporarly so you can see what's going on.

I suspect, however, that what's going on is that an open is failing, somthing you don't test for nearly enough. Whenever you say "open", an "or die "...: $!" should fly off of your fingers like second nature. I made that mistake with my first post here, and got back a million and a half replies yelling at me for it -- and it was good advice, but most people seemed to ignore the actual problem I was having. (Yes, that was mostly completly irrelevant. I'm in a retrospective mood.)

Oh, and another note -- you should never store passwords in plaintext like that. Not only is it a security risk, but at some point you'll end up with passwords in your head that have no busniess being there, and will just tempt you -- or at least clutter up memory space you could be using for more useful things.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by responing to this node).


In reply to Re: Can't find where 500 error is coming from by theorbtwo
in thread Can't find where 500 error is coming from by katgirl

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.