Hi all, newbie here again,

Here's a sample of some code that's confusing me:

#if ($selectRide = "LibertyRider2" || "RiderGroup")
# {foreach $my_element(@alllegs) {
# unless ($my_element eq '')
# {print " $my_element <br> \n";}
# }
# }
#else
# {print "You\'re good for the whole ride, Coast to Coast!<br> \n";}


if ($selectRide eq "PatriotRider" || "TributeRider" || "LibertyRider1")
      {print "You\'re good for the whole ride, Coast to Coast!<br> \n";}
else
       {foreach $my_element(@alllegs) {
             unless ($my_element eq '')
            {print " $my_element <br> \n";}
        }
    }

I can't seem to figure out why this isn't working for me.  If I use the code
in the top example (the commented out text), I can only print the contents
of @alllegs, regardless whether selectRide eq "LibertyRider2" ||
"RiderGroup".  I can't get the "else" part of the code to print.

If I use the bottom example, I can only print "You're good for the whole
ride, Coast to Coast!."  Again, the else statement seems to fall through the
hoop.

Is the unless statement negating what I'm trying to accomplish with the if
statement?  Is there another way I can accomplish what I want to do, based
on the value of $selectRide, keeping in mind that if I do want to print
what's in @alllegs, I still avoid printing blank lines where the elements in
@allegs are assigned no values?

Thanks again,

Jan Cohen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to