Skip Menu |

This queue is for tickets about the Syntax-Keyword-Dynamically CPAN distribution.

Report information
The Basics
Id: 131970
Status: open
Priority: 0/
Queue: Syntax-Keyword-Dynamically

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Not clear whether this is supposed to work; if so, should be tested; if not, should be documented
dynamically $var += 1; This doesn't work with `local`, but if it could work with `dynamically` it would be a pretty major win.
On Tue Feb 25 13:17:16 2020, TOBYINK wrote: Show quoted text
> dynamically $var += 1; > > This doesn't work with `local`, but if it could work with > `dynamically` it would be a pretty major win.
Hmm. No objection in principle to having it work. It would make cases like dynamically $logger->level += 1; a little neater too. I expect the implementation may be nontrivial to get working though; trying to detect all the cases. -- Paul Evans
I guess something that complicates it is that ($x+=1) is itself an lvalue. $ perl -E'my $x=1; ($x+=2) = 4; say $x'