How to solve: Can't use an undefined value as a HASH reference at /usr/share/perl5/XML/Stream.pm line 1165

The error: "Can't use an undefined value as a HASH reference at /usr/share/perl5/XML/Stream.pm line 1165" occurs when your Perl script is trying to use SASL authentication against a Jabber/XMPP server that does not support it or at least does not expect it.

Comment the following lines out of /usr/share/perl5/Net/XMPP/Protocol.pm and you should be good to go:

# if($self->{STREAM}->GetStreamFeature($self->GetStreamID(),"xmpp-sasl"))
# {
# return $self->AuthSASL(%args);
# }