in reply to Re: Perl OO and accessors
in thread Perl OO and accessors
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.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl OO and accessors
by Zaxo (Archbishop) on Nov 29, 2005 at 08:47 UTC | |
|
Re^3: Perl OO and accessors
by Aristotle (Chancellor) on Nov 29, 2005 at 04:16 UTC | |
by sauoq (Abbot) on Nov 29, 2005 at 04:32 UTC | |
by Aristotle (Chancellor) on Nov 29, 2005 at 04:36 UTC | |
by sauoq (Abbot) on Nov 29, 2005 at 04:48 UTC | |
by fergal (Chaplain) on Nov 29, 2005 at 11:42 UTC | |
| |
by Aristotle (Chancellor) on Nov 29, 2005 at 06:21 UTC | |
by sauoq (Abbot) on Nov 29, 2005 at 04:43 UTC | |
|
Re^3: Perl OO and accessors
by fergal (Chaplain) on Nov 29, 2005 at 11:09 UTC |