Protocol::XMLRPC::Value::Struct - XML-RPC struct
my $struct = Protocol::XMLRPC::Value::Struct->new(foo => 'bar'); my $struct = Protocol::XMLRPC::Value::Struct->new({foo => 'bar'}); my $struct = Protocol::XMLRPC::Value::Struct->new( foo => Protocol::XMLRPC::Value::String->new('bar'));
XML-RPC struct
new
Creates new Protocol::XMLRPC::Value::Struct instance. Elements can be provided as a hash or as a hash reference.
type
Returns 'struct'.
add_member
$struct->add_member(foo => 'bar'); $struct->add_member({foo => 'bar'}); $struct->add_member(foo => Protocol::XMLRPC::Value::String->new('bar'));
Adds value to the struct. Can be Perl5 scalar or any Protocol::XMLRCP::Value::* instance, including another struct.
members
my $struct = Protocol::XMLRPC::Value::Struct->new(foo => 'bar'); my $members = $struct->members;
Returns hash reference where values are objects.
value
my $struct = Protocol::XMLRPC::Value::Struct->new(foo => 'bar'); my $structref = $struct->value; # $structref is now {foo => 'bar'}
Returns serialized Perl5 hash reference.
to_string
my $struct = Protocol::XMLRPC::Value::Struct->new(foo => 'bar'); my $string = $struct->to_string; # <struct> # <member> # <name>foo</name> # <value><string>bar</string></value> # </member> # </struct>'
XML-RPC struct string representation.
Viacheslav Tikhanovskii, vti@cpan.org.
vti@cpan.org
Copyright (C) 2009, Viacheslav Tikhanovskii.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.
To install Protocol::XMLRPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::XMLRPC
CPAN shell
perl -MCPAN -e shell install Protocol::XMLRPC
For more information on module installation, please visit the detailed CPAN module installation guide.