TomDLux has asked for the wisdom of the Perl Monks concerning the following question:
I'm watching Steve Baker's Perl Attributes presentation in Phoenix. He mentions the predefined attribute 'lvalue', which is an alternative to passing an assignment value as a function argument. In a package definition ....
sub value : lvalue { my $self = shift; return $self->{value} } .... $obj->value() = 42; # compare with boring assignment ... $obj->value(42)
Is lvalue useful? are people using it? or is it just a dud?
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Is ": lvalue" attribute usefull or something to avoid?
by BrowserUk (Patriarch) on Feb 12, 2014 at 04:58 UTC | |
by tobyink (Canon) on Feb 12, 2014 at 12:01 UTC | |
by BrowserUk (Patriarch) on Feb 12, 2014 at 14:16 UTC | |
by tobyink (Canon) on Feb 12, 2014 at 15:05 UTC | |
Re: Is ": lvalue" attribute usefull or something to avoid?
by tobyink (Canon) on Feb 12, 2014 at 12:03 UTC | |
Re: Is ": lvalue" attribute usefull or something to avoid?
by Anonymous Monk on Feb 12, 2014 at 04:55 UTC | |
by tobyink (Canon) on Feb 12, 2014 at 12:14 UTC |
Back to
Seekers of Perl Wisdom