my $foo = 0; print ++$foo + $foo++; prints 3
Treating + as a function is the best way I've found to explain it.
do { local @_; alias $_[0] = ++$foo; # aliases to $foo alias $_[1] = $foo++; # aliases to anon 1 &sum # 2+1 }
In reply to Re^5: Will "$_[0]=shift" always resolve shift first?
by ikegami
in thread Will "$_[0]=shift" always resolve shift first?
by kyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |