I didn't actually run the code, but a quick review shows some suspicious lines:

### Grab SID and determine session_status my $sid = $session->id(); my $session_status = "false"; $session_status = $session->param("user_logged_in");

So, if the session does not contain a paraneter user_logged_in, you are overwriting the value "false" with undef.

Maybe what you want is this:
### Grab SID and determine session_status my $sid = $session->id(); my $session_status = $session->param("user_logged_in") // "false";

Later in the code (though not at line 89) you do the comparison which triggers the warning:

if ($session_status eq 'true')

Most probably that warning also causes the IIS to complain. IIS is expecting your response to start with a header, but gets a timestamp from the warning instead. The timestamp, starting with a [ character, is what you get from using CGI::Carp.

That said, I guess you are aware that this program looks more like 20th-century legacy than current best practice for a web application. We love Perl just because it is so simple to whip something up which will run for decades without a change, but still... given that the internet is no longer the same friendly place which it was 20 years ago, a bit of general refurbishment wouln't hurt.


In reply to Re: Perl v5 CGI error Use of uninitialized value $session_status by haj
in thread Perl v5 CGI error Use of uninitialized value $session_status by RedJeep

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.