That's why I said lvalue subs and tie.
You don't think I'd write all the spiel about irrevocable exposure and then go and suggest a method that is irrevocable.
The technique involves returning a tied lvalue which then calls a setter method with the new value. All this can be hidden behind a use statement. See Class::Accessor::Lvalue for an example.
In reply to Re^3: Perl OO and accessors
by fergal
in thread Perl OO and accessors
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |