Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Returning a tied scalarby diotalevi (Canon) |
on Apr 16, 2005 at 17:09 UTC ( [id://448486]=note: print w/replies, xml ) | Need Help?? |
The general solution for lvalue subroutines is to use Tie::Constrained.
The real answer is that you can't return variables. You can return values. The variable being assigned to already exists outside of the function and is a receptacle for the value that is to be returned by the right side of the assignment operation. So tough luck. You could write some compiler macro, I suppose, if you wanted.
In Section
Seekers of Perl Wisdom
|
|