suppose I have a table person with following columns, name, age,
salary. If use OOP to write a class like this,
package Person;
sub new{
$class=shift;
my $self = {};
$self->{_name} = undef;
$self->{_age} = undef;
$self->{_salary}= undef;
bless ($self,$class);
return $self;
}
#accessor method for name
sub name {
my $self = shift;
my $name = shift;
$self->{_name} = $name if defined($name);
return $self->{_name};
}
My question is, should I query/update the table at the same time in
above accessor method? If not, what's the best practice?
--
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"[EMAIL PROTECTED]
")'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>