User:Thomax:perl-xmlrpc
From OpenSimulator
(Difference between revisions)
												
			 (New page: <code> #!/usr/bin/perl  BEGIN {     # because the opensim http server just accept old HTTP/1.0 protocol!!!     $ENV{PERL_LWP_USE_HTTP_10} ||= 1;  # default to http/1.0 }  use RPC::XML::Cli...)  | 
			m (Users:Thomax:perl-xmlrpc moved to User:Thomax:perl-xmlrpc: wrong namespace)  | 
			||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | <  | + | __NOTOC__  | 
| + | {{Template:Quicklinks}}  | ||
| + | <br />  | ||
| + | |||
| + | <pre>  | ||
#!/usr/bin/perl  | #!/usr/bin/perl  | ||
| Line 25: | Line 29: | ||
     print "$key --> ". $val{$key}->as_string ."\n";  |      print "$key --> ". $val{$key}->as_string ."\n";  | ||
}  | }  | ||
| − | </  | + | </pre>  | 
Latest revision as of 18:22, 3 May 2011
#!/usr/bin/perl
BEGIN {
    # because the opensim http server just accept old HTTP/1.0 protocol!!!
    $ENV{PERL_LWP_USE_HTTP_10} ||= 1;  # default to http/1.0
}
use RPC::XML::Client;
my $client = new RPC::XML::Client('http://localhost:9000');
my $req = RPC::XML::request->new(
            'admin_broadcast',
            {
                password => 'secret',
                message => '2 + 3 = 23'
            }
);
my $res = $client->send_request($req);
my %val = %$res;
my $key;
foreach $key (keys %val) {
    print "$key --> ". $val{$key}->as_string ."\n";
}