>>>>> "GNat" == Nathan Torkington <gnat@frii.com> writes: GNat> Johan Vromans writes: JV> My point is that unlogical exceptions like @a = (++$i,++$i,++$i) JV> are hard to explain, and make people turn away from Perl. GNat> Could the optimizer spot multiple side-effects in an expression GNat> and pessimize it accordingly? If you mean a syntactic expression, then yes, I think that would be possible. In general, though, side effects might be hidden in subroutines, AUTOLOADed subroutines, evals, etc: perl -e 'sub f {++$i}; print ++$i, f(), "\n"' It doesn't seem obvious to me that there's an easy or foolproof way to do this, though, and a half-right solution would probably be worse that a the current situation, at least as far as being predictable and explainable. -- Stephen McCThread Previous | Thread Next