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
In Section
Seekers of Perl Wisdom