# Simple my $method = "examples.getStateName"; print SCNS->new("xmlrpc:http://betty.userland.com/RPC2")->$method(40); # Less simple my $service = SCNS->new("xmlrpc:http://betty.userland.com/RPC2"); my $debug = FileHandle->new(">./debug.txt"); # See below $service->class("examples"); # Default is STDERR $service->debug(1,*$debug); my $answer = $service->getStateName(4); if (! defined($answer)) { die $service->last_error(); } print $answer; return 1;This was mostly just an exercise to prove to myself that there is no magic here beyond the standard
eval "require $class";
and AUTOLOAD
hacks. Problems to sort out : 1) why installing AUTOLOAD subs in the symbol table doesn't work -- or more specifically, why XMLRPC::Lite::call() hangs; 2) How to AUTOLOAD methods with dots in them without declaring the string as a variable first.