but then you could use the magic of lvalue subs and tie to let you replace these 4 functions with 2 accessors
Using lvalue subs for accessors isn't generally a good idea. For instance, what would you do with $c->area = -42? And, how do you go back and change the interface later to avoid lvalue subs?
-sauoq "My two cents aren't worth a dime.";
In reply to Re^2: Perl OO and accessors
by sauoq
in thread Perl OO and accessors
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |