There does not seem to be a meaningful distinction in Perl. The return value is not intimately connected to the following assignment. Consider this snippet:
use Data::Dump; my $foo = 7; sub bar :lvalue { $foo } sub baz :lvalue { bar } dd $foo, bar(), baz(); baz = 9; for (baz) { dd $foo; $_ = 4; dd $foo; }
As you can see, $foo is passed around (by reference), but there is no telling if and where it is going to be assigned.
In reply to Re: can sub check context for lvalue vs rvalue context?
by Anonymous Monk
in thread can sub check context for lvalue vs rvalue context?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |