in reply to Object Troubles
The following demonstrates what happens:sub name { my $self = shift; # the following is the broken line $self = ref($self) || $self; if (@_) { $self->{Name} = shift; } return $self->{Name}; }
Even calling the constructors with the direct object syntax doesn't work. Of course, this all depends on how your methods work.my $a = new HIT; my $b = new HIT; print $a->Name('Corwin, Prince of Amber'); print $b->Name();
|
|---|