On Sat, Jun 26, 2010 at 5:37 PM, Craig DeForest
<[email protected]>wrote:

> Puneet,
>
> That is not an inconsistency.  All in-place "side effect" operators
> happen, well, in-place.  That should not be surprising.
>

In fairness to Puneet, in C, the following are equivalent on basic data
types:

a += 5;
a = a + 5;

except that the first one is a bit more efficient, I think. However, it is
not necessarily equivalent for C++ objects which may overload the = and +=
operators.

I agree that there is nothing inconsistent from the Perl standpoint, but
you'd have to know how object-oriented Perl works to get that one on first
pass. I suspect that Puneet's background is more in C (or some other
language) rather than in Perl. Puneet, is this correct?

David
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to