Re: More Newbie OOP Questions ...

2002-10-18 Thread Paul Johnson
On Thu, Oct 17, 2002 at 01:49:50PM -0800, Michael Fowler wrote: > On Wed, Oct 16, 2002 at 11:52:44PM +0200, Paul Johnson wrote: > > The constructor, then blesses $name into the class "Horse", or more > > accurately, blesses a reference to $name. > > You were right the first time; bless blesses $na

Re: More Newbie OOP Questions ...

2002-10-18 Thread Michael Fowler
On Wed, Oct 16, 2002 at 11:52:44PM +0200, Paul Johnson wrote: > The constructor, then blesses $name into the class "Horse", or more > accurately, blesses a reference to $name. You were right the first time; bless blesses $name. You have to pass a reference so bless can modify the original variabl

Re: More Newbie OOP Questions ...

2002-10-16 Thread Paul Johnson
On Tue, Oct 15, 2002 at 09:26:33PM -0500, montana wrote: > Take the following example from the perlboot manual: > { package Horse; >@ISA = qw(Animal); >sub sound { "neigh" } >sub name { > my $self = shift; > $$self; >} >

More Newbie OOP Questions ...

2002-10-16 Thread montana
Take the following example from the perlboot manual: { package Horse; @ISA = qw(Animal); sub sound { "neigh" } sub name { my $self = shift; $$self; } sub named { my $class = shift; my $name =