Net::XMPP2::Util - Utility functions for Net::XMPP2
use Net::XMPP2::Util qw/split_jid/; ...
These functions can be exported if you want:
This function applies the stringprep profile for resources to $string and returns the result.
$string
This function applies the stringprep profile for nodes to $string and returns the result.
This function joins the parts $node, $domain and $resource to a full jid and applies stringprep profiles. If the profiles couldn't be applied undef will be returned.
$node
$domain
$resource
This is a plain concatenation of $user, $domain and $resource without stringprep.
$user
See also prep_join_jid
This function splits up the $jid into user/node, domain and resource part and will return them as list.
$jid
my ($user, $host, $res) = split_jid ($jid);
This applies stringprep to all parts of the jid according to the RFC 3920. Use this if you want to compare two jids like this:
stringprep_jid ($jid_a) eq stringprep_jid ($jid_b)
This function returns undef if the $jid couldn't successfully be parsed and the preparations done.
This function makes the jid $jid a bare jid, meaning: it will strip off the resource part. With stringprep.
This function makes the jid $jid a bare jid, meaning: it will strip off the resource part. But without stringprep.
This method returns a boolean which indicates whether $jid is a bare JID.
This method takes a XML::Writer as first argument ($w) and the rest key value pairs:
$w
simxml ($w, defns => '<xmlnamespace>', node => <node>, prefixes => { prefix => namespace, ... }, fb_ns => '<fallbackxmlnamespace for all elementes without ns or dns field>', );
Where node is:
<node> := { ns => '<xmlnamespace>', name => 'tagname', attrs => [ ['name', 'value'], ... ], childs => [ <node>, ... ] } | { dns => '<xmlnamespace>', # dns will set that namespace to the default namespace before using it. name => 'tagname', attrs => [ ['name', 'value'], ... ], childs => [ <node>, ... ] } | "textnode"
Please note: childs stands for child sequence :-)
childs
child sequence
Robin Redeker, <elmex at ta-sa.org>, JID: <elmex at jabber.org>
<elmex at ta-sa.org>
<elmex at jabber.org>
Copyright 2007 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::XMPP2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::XMPP2
CPAN shell
perl -MCPAN -e shell install Net::XMPP2
For more information on module installation, please visit the detailed CPAN module installation guide.