Jabber::Lite (code)

use Jabber::Lite;

my $jabber = Jabber::Lite->new(debug => 1);
$jabber->connect(
        Host => 'talk.google.com',
        Port => 5222,
        Domain => 'gmail.com',
        );

if ($jabber->is_connected()) {
    print "connected to Jabber.\n";
}

$jabber->authenticate(
        Username => 'user@gmail.com',
        Password => 'pass',
        );

if ($jabber->is_authenticated()) {
    print "Authenticated to Jabber.\n";
}