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 = shift;
bless \$name, $class;
}
}
my $talking = Horse->named("Mr. Ed");
print $talking->name, " says ", $talking->sound, "\n";
When we create the instance, what values go into @_ so that $talking-name returns the
de-referenced scalar "Mr. Ed", $class receives the value Horse, and $name receives the
reference $talking? Or am I wrong on how this works?
Thanks.
SA
P.S. (Please use plain English, for I am not the most proficient Perl programmer yet.)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]