Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate lvalue context to && and ||
I did this for the last statement in an lvalue sub (and the argument to ‘return’ in an lvalue sub) in commit 2ec7f6f. It turns out that it needs to apply in other lvaluish contexts, too: $ ./perl -Ilib -le 'for($a||$b){$_++} print $b' 1 $ ./perl -Ilib -le 'for(pos $a || pos $b){$_++} print pos $b' Modification of a read-only value attempted at -e line 1. If I can assign to $b through this construct, then why not pos?
- Loading branch information
Father Chrysostomos
committed
Oct 25, 2013
1 parent
447779a
commit 2e73d70
Showing
2 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters