On Thu, Jul 15, 2010 at 2:31 PM, Jan Dubois <jand@activestate.com> wrote: > $ perl -E 'sub AUTOLOAD { say $AUTOLOAD; ++$i } say a() + b() * c()' > main::a > main::b > main::c > 7 > > So it does call a() first, even though the multiplication of b() and c() > happens before the result is added to a(). But there is nothing in the > operator precedence description that would forbid Perl from delaying > evaluation of a() until after b() * c() has been computed. C<< a() >> is a term. Perlop says "A TERM has the highest precedence in Perl." Doesn't that meant that all terms get evaluated first, then all lower precedence operations happen. And because terms are left associative, they should be evaluated left to right. -- DavidThread Previous | Thread Next