On 09/24/2006 12:35 PM, chen li wrote:
--- "Mumia W." <[EMAIL PROTECTED]>
wrote:
On 09/22/2006 07:50 AM, chen li wrote:
--- "Mumia W."
<[EMAIL PROTECTED]>
wrote:
That "redundancy" allows you to use inheritance.
If
you have a class
Employee, with an expanded set of fields, this
method makes it possible
to add the fields without having to modify each
method that uses them.
Where can I find more about this kind of syntax?
[...]
Read the "Class Data" section in perltoot.
Hi Mumia,
I don't think I get the point.
Write an example. Create a superclass and a subclass where the
superclass has class data that you want to be able to override in the
subclass (but *without* having to override every method that uses that
data).
If my purpose of using
AUTOLOAD is to handle 1) many attributes in construct
2) create an un-predined method on the fly, what will
happen if I make the following changes:
in sub new change
my $self = {_permitted => \%fields,%fields,};
to my $self =\%fields;
in sub AUTOLOAD comment out the unless statement.
Do you think these change will affect inheritance?
Why didn't you test what happens when you do that? What happens when you
create three different objects and manipulate them? What happens with
those object when you go back to the original code?
Thanks in advacne,
Li
########### copy from perltoot
package Person;
[...]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>