Kevin Old <[EMAIL PROTECTED]> wrote: : Hello everyone, : : I have an if statement that has three different clauses that : need to be met before it should be executed, and for some : reason I can't get the conditionals to work. Here's the snip : of code:
Start smaller, with something you know works and build up from there. Testing will show this is the better approach. if ( 1 && 1 || 0 ) { print "*********IT WAS DELIVERED*******\n"; } Now substitute the second 1. if ( 1 && $activity ->child('Status') ->child('StatusCode') ->child('Code') ->value eq 'DS' || 0 ) { print "*********IT WAS DELIVERED*******\n"; } If it fails here, you have a problem in that value. If it succeeds, you have a problem with the "defined" value. : print "STCode: : ",$activity->child("Status")->child("StatusType")->child("Code : ")->value,"\n"; # This line prints I : print "SCCode: : ",$activity->child("Status")->child("StatusCode")->child("Code : ")->value,"\n"; # This line prints DS These are not really useful because some white space may be hidden. Wrapping the text in quotes should show it. printf qq(STCode: "%s"\n), $activity->child('Status') ->child('StatusType') ->child('Code') ->value; printf qq(STCode: "%s"\n), $activity->child('Status') ->child('StatusCode') ->child('Code') ->value; HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>