A tied scalar can check before setting. Of course, in your example, if you had tied the foo element, then you'd have encapsulation.They violate encapsulation. A normal mutator can check the supplied ar +gument before setting the attribute it is protecting, an lvalue subro +utine never gets that chance.
In reply to Re^2: Encapsulation without methods
by Roy Johnson
in thread Encapsulation without methods
by Roy Johnson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |