Documentation for this is pretty spotty. Not in terms of quantity, but quality. At least for a newcomer to the world of streaming XML.
First, a couple of things on setting this up.
In addition to the latest XML::Stream, I also had to modify Net::XMPP’s Protocol.pm module by commenting out lines 1807 to 1810. Without this change the module would return errors when it tried to make uninvited SASL connection to the chat server (on RHEL 6 most modules installed from CPAN are located under /usr/local/share/perl5).
Once I got past that, this little test script worked just fine:
#!/usr/bin/perl -w # Simple XMPP client test script use Net::XMPP; use Net::XMPP::Client; my $xmppUsr = "chatuser"; my $xmppPass = "xxxxx"; my $xmppDomain = "im.example.com"; my $xmppHost = "server23.example.com"; my $conn = Net::XMPP::Client->new( debuglevel=>'1'); $conn->Execute( hostname => $xmppDomain, tls => '1', username => $xmppUsr, password => $xmppPass, ); my $status = $conn->Connected(); print "is connected: ", $status, "n"; $conn->Disconnect; __END__;