[JDEV] Perl code sample needed...
Matt Mankins
mankins at media.mit.edu
Sat Jan 25 18:24:47 CST 2003
I've taken to liking Twig.
http://www.xmltwig.com/
But you can start off with something else while you're trying to figure
stuff out... XML::Simple works for playing around...
Here's an XML/Perl Quick start
http://www.xml.com/pub/a/2001/04/18/perlxmlqstart1.html
This page gives you links that are handy:
http://standards.ieee.org/resources/spasystem/twig/perl_xml/perl_xml.html
Good luck,
Mankins
On Sat, 25 Jan 2003, rebbaj rebbaj wrote:
>
> 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...
>
> Thanks,
>
> Rebbaj
More information about the JDev
mailing list