Posted by rlee0001 on 02/13/06 01:45
Sorry, my response wasn't very clear. Your code was:
print '12 == 12 : ' . print 12 == 12;
As you can see, you are passing a call to print to another call to
print. That is -- you are passing print to print. If you remove the
second print like so:
print '12 == 12 : ' .12 == 12;
The problem might go away but you run the risk of having all kinds of
"order of operations" issues. So as a general rule, I always put
brackets around equations used with the dot operator like so:
print '12 == 12 : ' .(12 == 12);
As you said: the brackets may be redundant (and probably are) but I do
this out of habbit now because I have been bit my this before and
debugging order of operations bugs can be a pain. In any case I think
the habbit is a good one anyways.
-Robert
[Back to original message]
|