Hi all, I've just been reading a bit about accessor get/set methods. I have
a method:
sub even{
my $self = shift;
my $even = shift;
$self->{_even} = $even if defined($even);
return $self->{_even};
}
This basically does what a get and set method would do. So why would I need
a set/get methods? This value is passed to the object like so:
$object->even('even_value');
This is setting the value here, although I'm sure this isn't the recommended
way of doing it. Should objects only have values set when instatiating?
my $object = the_object->new('even_value');
Basically I think I need to clarifiy the difference between an accessor /
mutator type method and get/set methods, can anyone explain this?
Cheers,
G :)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>