First, keep in mind that Perl follows a link. It means
sum(++$x, ++$x)
basically coincides with
do {
local @_;
alias $_[0] = ++$x;
alias $_[1] = ++$x;
∑
}
Pre-increment , *, , $_[0] $_[1] $x. , sum $x (2) .
: .
* — This isn't documented, but you're asking why Perl is behaving the way it does.