Isn't this because the precedence makes it:
$x = undef; my $a=($x // warn 'RHS evaluated'); say $a;
Since $x is not defined, // returns the right hand side, and the call to warn returns 1 (true) to report success.
Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.
In reply to Re^4: Perl5 Language Extension: Definedness-Triggered Shortcut Operators
by aaron_baugher
in thread RFC: Perl5 Language Extension: Definedness-Triggered Shortcut Operators
by martin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |