It's because unlike += the ++ perl operator (prefix or postfix) returns an rvalue, not an lvalue. You can't do ++$a = 8 or $a++ = 8 either.
Update: swapped rvalue and lvalue, as noted by calin.
In reply to Re: Pre-increment *and* Post-increment
by ambrus
in thread Pre-increment *and* Post-increment
by cog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |