XML Reference problem

S

sharon

I have an XML hash that has $xmlResults->{Ack} = Failure
I use an if statement with $xmlResults->{Ack} == "Success" and getting
true instead of false.
I about to pull some hairs about and I don't have to many left, please
help me save the last ones I have.


thanks
Arik
 
P

Peter Makholm

I use an if statement with $xmlResults->{Ack} == "Success" and getting
true instead of false.

When comparing strings you have to use the string comparison operator
instead of the number comparison operator. That is to use
'$xmlResults->{Ack} eq "Sucess"' instead.

By using '==' you're comparing the numeric value of both sides, which
is very probale 0.

//Makholm
 
S

sharon

When comparing strings you have to use the string comparison operator
instead of the number comparison operator. That is to use
'$xmlResults->{Ack} eq "Sucess"' instead.

By using '==' you're comparing the numeric value of both sides, which
is very probale 0.

//Makholm

I'm not going to be completely bold after all, thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top