[JDEV] Perl code sample needed...

rebbaj rebbaj rebbaj2000 at yahoo.co.uk
Sat Jan 25 17:55:46 CST 2003

I am trying to write a routine in Perl where I can send a iq roster request and then parse through all the responses such that I can put them in an array.  While I could do this with a call such as "my $roster = $iq->GetXML()" followed by a bunch of regular expressions, this seems painfull.  

I would like to populate a couple of parallel arrays such that they end up as follows after having read back 4 returned roster items:

@jids = (user1 at jabber.org, user2 at jabber.org, user3 at jabber.org, user4 at jabber.org)

@name = (Joe, fred, Tim, Sue)

@subscription = (both, both, from, to)

@group = (work, work, friend, work)

As I do not quite understand how the parsing would work, would someone mind doing a quick posting of an example which would place all the jids, groupnames, etc in an array?  It is just not clear to me how I would structure the logic to do this with a while...



With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20030125/97505da9/attachment-0002.htm>

More information about the JDev mailing list