pankajisgarg has asked for the wisdom of the Perl Monks concerning the following question:
package Person; use strict; use warnings; sub new { my $class = shift; my $self = {}; $self->{NAME} = shift; bless ($self, $class); return $self; } sub getPerson { my $o = Person->new ("TestName"); return $o; } sub createUpdater { my $self = shift; my $o = Person2->new (\$self); return $o; } #Accessor sub Name { $_[0]->{NAME}=$_[1] if defined $_[1]; $_[0]->{NAME}; } package Updater; use strict; use warnings; sub new { my $class = shift; my $self = {}; $self->{Person} = \shift; bless ($self, $class); return $self; } sub updateName { my $self = shift; #my $pe1 = \$self->{Person}; #bless ($pe1, "Person"); my $pe1 = $self->{Person}; $self->{NAME} = $pe1->Name; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Aggregation problem
by GrandFather (Saint) on Dec 26, 2007 at 21:12 UTC | |
|
Re: Aggregation problem
by TGI (Parson) on Dec 26, 2007 at 23:08 UTC | |
|