firstaspect has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm a newbie to Perl (though with years of PHP experience) and am having the following problem.
I'm building a data structure to send using SOAP functions, example:
$param = SOAP::Data->name("ListOfContact" => \SOAP::Data->value( SOAP::Data->name("Contact" => \SOAP::Data->value( SOAP::Data->name("ContactId" => $contact->{ContactId}), SOAP::Data->name("ContactLastName" => $contact->{LASTNAME}), )) ));
This works as I want and expect. I'd like to add some more Data->name sections however I'd like to do this dynamically based on a database query. So in each row returned from the database I'm constructing a string variable in the foreach like:
"SOAP::Data->name("DynamicFieldName" => DynamicValue),"
I'd then like to somehow include these new lines into the SOAP param constructor, but not sure how to get it out of the string variable without it just printing the string itself. I also tried building the whole param variable into one string var and trying some sort of eval on it.
I hope that makes sense and any help would be really appreciated.
Thanks very much, Mark.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using a dynamic variable within a SOAP data structure
by Khen1950fx (Canon) on Apr 20, 2011 at 12:29 UTC | |
|
Re: Using a dynamic variable within a SOAP data structure
by firstaspect (Initiate) on Apr 20, 2011 at 12:58 UTC | |
by Khen1950fx (Canon) on Apr 20, 2011 at 13:47 UTC | |
|
Re: Using a dynamic variable within a SOAP data structure
by InfiniteSilence (Curate) on Apr 20, 2011 at 12:23 UTC |