<P>Hello jabber people.</P>
<P>I am hoping that someone can help me out with how the Perl Net::Jabber library should be used. Note that I am also somewhat new to perl so if I get confused by some of the syntax, you will have to excuse me. The examples in the Oreily book were rather helpful but I seem to be having problems in calling and receiving IQ information.</P>
<P>Here is what I am trying to send and receive in XML:</P>
<P>SENT:<BR><iq id="jcl_9" type="get"><BR> <query xmlns="jabber:iq:roster"/><BR></iq></P>
<P>RECV:<BR><iq <A href="mailto:from='rebbaj@jabber.org/Perl'">from='rebbaj@jabber.org/Perl'</A> id='jcl_9' type='result'><BR> <query xmlns='jabber:iq:roster'><BR> <item <A href="mailto:jid='rebbaj@jabber.com'">jid='rebbaj@jabber.com'</A> name='rebbaj' subscription='both'/><BR> <item <A href="mailto:jid='rebbaj2@jabber.com'">jid='rebbaj2@jabber.com'</A> name='rebbaj2' subscription='both'/><BR> </query><BR></iq></P>
<P>The code stub that I have written to do this is as follows. I suspect that I have the flow a bit wrong and I am not using the optimal calls to parse the resulting returned roster data... Any help would be appreciated....</P>
<P>rebbaj</P>
<P>------------------------------------------------<BR>#!/usr/bin/perl<BR>use Net::Jabber qw(Client);<BR>use strict;<BR>my $c=Net::Jabber::Client->new();<BR>$c->Connect('hostname'=> 'jabber.org', 'port'=>5222);</P>
<P>$c->AuthSend('username'=> 'rebbaj',<BR> 'password'=> 'secret',<BR> 'resource'=> 'Perl');</P>
<P>$c->SetCallBacks('presence'=> \&handle_presence);<BR>$c->SetCallBacks('iq'=> \&handle_iq);<BR>$c->PresenceSend();</P>
<P>My $IQ = new Net::Jabber::IQ();<BR>$IQ->NewQuery("jabber:iq:roster"); # Does this actually make the IQ get request?$c->Send($IQ); # is this call necessary?</P>
<P>print "involking process\n";<BR>$c->Process();</P>
<P> </P>
<P> </P>
<P><BR>$c->Disconnect;<BR>exit(0);</P>
<P>sub handle_presence {<BR> my ($sid, $presence) = @_;</P>
<P> my $show = $presence->GetShow() || 'online';<BR> <BR> print "presence packet received $show\n";<BR>}</P>
<P>sub handle_iq {<BR> my ($sid, $iq) = @_;</P>
<P> my $querytag = $iq->GetQuery();</P>
<P> <BR> print "iq packet received $querytag\n";<BR>}</P>
<P> </P><p><p><br><hr size=1><a href="http://uk.yahoo.com/mail/tagline_xtra/?http://uk.docs.yahoo.com/mail_storage.html"><b><font face="Arial" size="2">With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs</font></b></a><br>