|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
> Perl 5.6 question: Why would you want to use an lvalue sub?
Suppose you have an object, $car. $car has a piece of member data
called `color'.
$the_color = $car->color();
This gets the car's color.
$car->color() = 'blue';
This sets the car's color to blue. Ooops, no it doesn't, unless you
have perl 5.6.0 and you said that the `color' function was :lvalue.
Otherwise, it's just a syntax error.
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|