http://qs321.pair.com?node_id=1076965


in reply to Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?

Missed precedence. Eily's explanation reads much better than mine.

$c points to a memory address with a stored value. Your assignment changes that value. So at the end, you have an array reference containing the same address (with the same incremented value). And you are printed the same value.

  • Comment on Re: Why does the first $c evaluate to the incremented value in [$c, $c += $_] ?
  • Download Code