我正在使用Data :: Dumper从SOAP消息传递服务器检索信息,并需要一些帮助来分配处理返回值。我的代码是:正在检索Data :: Dumper元素
my $cm = new SOAP::Lite
encodingStyle => '',
uri => "$axltoolkit",
proxy => "https://$cucmip:$axl_port/axl/";
my $res =$cm->getUser(SOAP::Data->name('userid' => "387653"));
unless ($res->fault) {
$Data::Dumper::Incident=3;
my($reply) = $res->paramsall();
my ($devices) = $reply->{user}{associatedDevices}{device};
print $devices->[0]."\n";
print $devices->[1]."\n";
print $devices->[2]."\n";
{设备}可能包含任意数量的元素,从而代替呼叫$设备 - > [0],[1],等等 - 这可能吐出所有返回装置?我试过$ _和@_,但没有运气,因为它只是返回第一个设备。
任何帮助表示赞赏。
感谢
只需从http://perldoc.perl.org/perlreftut.html#Using-References – tadmc 2012-01-07 03:11:44