<P>Thanks Matt and Chris for the replies.
<P>It seemed reasonable that one could write an algorighm as follows with the Net::Jabber pm. What would the XXXX's be? I would also like to do this with the returned presence data...<BR>---------------------------------- <BR>use Net::Jabber qw();<BR><BR>my $Connection = new Net::Jabber::Client();<BR>$Connection->SetCallBacks(iq=>\&InIQ);
<P># request the roster from the server<BR>my $iq_req = Net::Jabber::IQ->new();<BR>$iq_req->SetIQ(type=>"get", id=>"mpt_1");</P>
<P># is there a native call to do this?<BR>$iq_req->InsertRawXML('<query xmlns="jabber:iq:roster"/>');<BR><BR>$Connection->Send($iq_req);</P>
<P>while(defined($Connection->Process())) { }
<P>sub InIQ # callback routine<BR>{<BR> my $sid = shift;<BR> my $iq = shift;<BR> $roster = $iq->XXXXXX(); # what should I be calling here?
<P> foreach $item (XXXXXXX) {<BR> print $item->XXXXX, "\n"; # print jid<BR> print $item->XXXXX, "\n"; # print name<BR> print $item->XXXXX, "\n"; # print ask<BR> print $item->XXXXX, "\n"; # print subscribe<BR> print $item->XXXXX, "\n"; # print group<BR>}
<P>}
<P> <B><I>Chris Wilkes <cwilkes-jabber@ladro.com></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Sat, Jan 25, 2003 at 11:55:46PM +0000, rebbaj rebbaj wrote:<BR>> <BR>> I am trying to write a routine in Perl where I can send a iq roster<BR>> request and then parse through all the responses such that I can put<BR>> them in an array. While I could do this with a call such as "my<BR>> $roster = $iq->GetXML()" followed by a bunch of regular expressions,<BR>> this seems painfull.<BR><BR>What Perl module are you using to do the "$iq->GetXML()"? If you send<BR>me your code that does that I can add code to split out the results.</BLOCKQUOTE><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>