in reply to Re: can sub check context for lvalue vs rvalue context?
in thread can sub check context for lvalue vs rvalue context?
Either way, a new value has to be passed into 'X', so it has to be called first in an lvalue context. Then it depends on whether or not perl makes a separate call to the function to do the equivalent of a fetch operation.
If it does, the 2nd call would call it in rvalue context, but I'd think the 2nd call wouldn't happen, as perl would already have the value it stored and not need to make a 2nd call.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: can sub check context for lvalue vs rvalue context?
by BrowserUk (Patriarch) on May 09, 2018 at 11:23 UTC | |
by perl-diddler (Chaplain) on May 10, 2018 at 07:00 UTC | |
by BrowserUk (Patriarch) on May 10, 2018 at 07:19 UTC | |
by perl-diddler (Chaplain) on May 10, 2018 at 18:54 UTC | |
by BrowserUk (Patriarch) on May 10, 2018 at 19:28 UTC | |
| |
by ikegami (Patriarch) on May 11, 2018 at 19:51 UTC |