Do you know where your variables are? | |
PerlMonks |
Re: an odd if then statementby HyperZonk (Friar) |
on Jul 23, 2001 at 21:33 UTC ( [id://99094]=note: print w/replies, xml ) | Need Help?? |
One of the big problems here is that == is used
for number equality, not string equality. Use To do what you are attempting in this line. However, because things may change, this is probably not the best way to approach what you are trying to do. What if someday you need to be able to evaluate '35+15' or some other such thing? If the discounts are always going to appear in this format, you could do something like:
and then do your quantity calculations. -HZ
In Section
Seekers of Perl Wisdom
|
|