Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I update a field in the Perl output?

Posted on 2011-03-02
5
Medium Priority
?
309 Views
Last Modified: 2012-08-14
As you have described before, I can now get the value from the Perl output.

Now I want  to update this field, which means I want to overwrite it. Let's say I want to change the status field to 'incomplete'.

I tried the following but it did not work:

$ssc->{geckStates}[0]{status} = 'THIS IS A WSDL TEST';

Open in new window


Can you please explain me how to do it?

Note: I am not sure it it matters but I communicate with a web application via a web service. And I try to upload a field in this application.

Thanks,
0
Comment
Question by:Tolgar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:Tolgar
ID: 35018217
Actually, overwrite is not a right word in the question. I want to add someother text to that field like 'THIS IS A WSDL TEST'
0
 
LVL 27

Expert Comment

by:wilcoxon
ID: 35018234
That line of code will update the value in the perl data structure.  You can see this by doing

print Dumper $ssc->{geckStates};

after the update line.

How to update the value in your web application completely depends on your web service and web app.
0
 

Author Comment

by:Tolgar
ID: 35018252
Sorry for the confusion. Actually this overwrites the solution field. But I wan to append it to that field. How can I do it?

Thanks,
0
 
LVL 27

Expert Comment

by:wilcoxon
ID: 35018259
So are you saying that you want to replace status 'Completed' with 'THIS IS A WSDL TEST' or that you want to add the string after Completed?  The code you posted will do the former.  For the latter, this will work:

$ssc->{geckStates}[0]{status} .= ' THIS IS A WSDL TEST';
0
 
LVL 27

Accepted Solution

by:
wilcoxon earned 2000 total points
ID: 35018279
.= appends to the existing value (rather than = overwriting).  If you don't add a space in the string to be appended (like I did), you end up with something like 'CompletedTHIS IS A WSDL TEST'.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question