in reply to Re: order of evaluation of operands in thread order of evaluation of operands
That's why you can safely say: ($a,$b) = (shift, shift) to get the first two values from @_, IN THE RIGHT ORDER.
the comma operator is one that definitely evaluates left to right. it does this even in C/C++ (in addition to &&, and, ||, or and ?:). i know that those evaluate left to right. but are all operators guaranteed to evaluate left to right. just because your computer does it that way does not necesarily mean that all will. granted Perl has less computer/software dependant items like C and C++, but i'd like to know for sure what the case is. preferably some mention in documentation or an answer from someone who's read the source code or a link to a tutorial or something.
|