Net::OSCAR::XML -- XML functions for Net::OSCAR
version 1.927_001
We're doing the fancy-schmancy Protocol.xml stuff here, so I'll explain it here.
Protocol.xml contains a number of "OSCAR protocol elements". One <define> block is one OSCAR protocol elemennt.
When the module is first loaded, Protocol.xml is parsed and two hashes are created, one whose keys are the names the the elements and whose values are the contents of the XML::Parser tree which represents the contents of those elements; the other hash has a family/subtype tuple as a key and element names as a value.
To do something with an element, given its name, Net::OSCAR calls protoparse("element name"). This returns a Net::OSCAR::XML::Template object, which has pack and unpack methods. pack takes a hash and returns a string of binary characters, and unpack goes the other way around. The objects are cached, so protoparse only has to do actual work once for every protocol element.
protoparse("element name")
Net::OSCAR::XML::Template
pack
unpack
protoparse
To install Net::OSCAR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OSCAR
CPAN shell
perl -MCPAN -e shell install Net::OSCAR
For more information on module installation, please visit the detailed CPAN module installation guide.