![]() |
|
Think about Loose Coupling | |
PerlMonks |
Re: Perl v5 CGI error Use of uninitialized value $session_statusby haj (Priest) |
on Oct 29, 2019 at 07:28 UTC ( #11108067=note: print w/replies, xml ) | Need Help?? |
I didn't actually run the code, but a quick review shows some suspicious lines:
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:
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 Section
Seekers of Perl Wisdom
|
|