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


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

Looks the same here, with Perl 5.18.1 on Linux:

perl -MData::Dumper -E 'say join ", ", +$c,$c+=1 for 1..3'

1, 1 2, 2 3, 3

perl -MData::Dumper -E 'say join ", ", --$c,$c+=1 for 1..3'

0, 0 0, 0 0, 0

perl -MData::Dumper -E 'say join ", ", - -$c,$c+=1 for 1..3'

0, 1 1, 2 2, 3