in reply to Re^2: ${^POSTMATCH} problem
in thread ${^POSTMATCH} problem
Yeah, The behaviour of ($foo = 1) . ($foo = 2) . ($foo = 3) used to be roughly equivalent to
my $x = ""; $x .= ( $foo = 1 ); $x .= ( $foo = 2 ); $x .= ( $foo = 3 );
But now, it's roughly equivalent to
my $x = join("", ( $foo = 1 ), ( $foo = 2 ), ( $foo = 3 ), );
In both cases, $foo itself is being put on the stack. The difference is when it's used (before it has a chance to be changed by later assignments, or after).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: ${^POSTMATCH} problem
by LanX (Saint) on Jun 14, 2020 at 16:01 UTC | |
by ikegami (Patriarch) on Jun 15, 2020 at 04:22 UTC | |
by ikegami (Patriarch) on Jun 15, 2020 at 04:26 UTC |
In Section
Seekers of Perl Wisdom