http://www.perlmonks.org?node_id=811533


in reply to Re^3: Boolean counter?
in thread Boolean counter?

$i appears only once, the behaviour is defined
$ perl -MO=Deparse,-p -le"print - --$i" BEGIN { $/ = "\n"; $\ = "\n"; } print((-(--$i))); -e syntax OK
You were thinking of
print(-( ++$i - --$i ))