Use of uninitialized value in pattern match...Simple.pm line 1561
I noticed this error when logging in with WWW::Mechanize from our monitoring system.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Lemonldap/NG/Portal/Simple.pm line 1561.
A normal login from a browser does not cause this error.
I propose this patch or something similar if more appropriate.
--- Lemonldap/NG/Portal/Simple.pm
+++ Lemonldap/NG/Portal/Simple.pm
@@ -1559,7 +1559,7 @@
);
$self->updateStatus;
if ( !$self->{noAjaxHook}
- and $self->http('Accept') =~ m#(?:application|text)/json# )
+ and defined $self->http('Accept') and $self->http('Accept') =~ m#(?:application|text)/json# )
{
if ( ( my $code = $self->{error} ) > 0 ) {
print $self->header(