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
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
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;
>}
>
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 =