in reply to Re^4: Will "$_[0]=shift" always resolve shift first?
in thread Will "$_[0]=shift" always resolve shift first?
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 }
|
|---|