in reply to Re: Re (tilly) 5: Inheriting object data
in thread Inheriting object data
You could add another method in there to reset the name and password. You could store references to $name and $pass in the hash, so updating the parent data is reflected in the children.package Parent; { my ($name, $pass); sub new { my $class = shift; my $self = {}; if (@_) { ($name, $pass) = @_; } @$self{'name', 'pass'} = ($name, $pass); bless($self, $class); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 5: Inheriting object data
by eg (Friar) on Feb 17, 2001 at 08:51 UTC | |
|
Re: Re: Re: Re (tilly) 5: Inheriting object data
by archon (Monk) on Feb 17, 2001 at 09:57 UTC |