Thread

Posted on Tue Jul 24 22:05:31 2007 by chandrag
How to convert ArrayOfstring in SOAP into an array of PERL?

Hi,

I've used perl code with SOAP::Lite for accessing a web server.
I've got the result as ArrayOfstring.
I don't understand how to convert it into perl variable to print all those strings, what i actually need.
cuz, it's giving the result as

ARRAY(0x39451cc)

i don't understand what does it mean. In fact, it has to give an array that contains strings(some ids).
hope somebody helps with this problem.

thank u
chandrag
Direct Responses: 5853 | Write a response
Posted on Wed Aug 1 05:02:21 2007 by saramic in response to 5807
Re: How to convert ArrayOfstring in SOAP into an array of PERL?
the result is a reference to an array. Assuming that it really is just an array of strings then you can print
print join ',', $arrayRef;
if that does not work or you are not sure what is in there, I suggest using Data::Dumper to print out the whole data structure.
use Data::Dumper; print Dumper $arrayRef;
this assumes that this is only an array ref. If you do not extract the array from the SOAP object you may get the whole SOAP object out which will end with something along the lines of
$VAR1 = bless( { . . . '_request' => bless( { '_method' => 'POST', '_headers' => bless( { . . . }, 'SOAP::SOM' );
which will have a whole heap more information. cheers Michael
Write a response