in reply to Using the strict module in object oriented programming
Yes, this is one of the standard complaints with the usual method of creating objects in Perl. I can think of two options for you, but both of them are quite a lot of work.
Firstly, you could stop using the hash contents directly and only access your objects' attributes with accessor methods. You can even do this for object access within the class itself.
Secondly you can take a look at Inside-Out Objects. This is a new way of building objects in Perl. It's becoming quite popular and it specifically addresses your problem.
Update: Changed reference to something a bit more recent. But see also the references in xdg's post below.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using the strict module in object oriented programming
by Ovid (Cardinal) on Jul 25, 2006 at 13:59 UTC | |
by jdhedden (Deacon) on Jul 25, 2006 at 20:17 UTC | |
|
Re^2: Using the strict module in object oriented programming
by xdg (Monsignor) on Jul 25, 2006 at 13:52 UTC | |
by bart (Canon) on Jul 25, 2006 at 21:05 UTC | |
by xdg (Monsignor) on Jul 25, 2006 at 22:38 UTC | |
by Aristotle (Chancellor) on Jul 25, 2006 at 22:52 UTC | |
by xdg (Monsignor) on Jul 25, 2006 at 23:13 UTC | |
|
Re^2: Using the strict module in object oriented programming
by Codon (Friar) on Jul 25, 2006 at 17:18 UTC |