Oh Dear, looks like I'm not doing too well with my first stab at OOP.
The methods I'm using in this code are predominantly written so that the method can be used to set or call the value depending on whether you pass it any values:
sub method{
my ($self) = shift;
if (@_){
$self->{MethodName} = shift;
}
else{
ref $self
? $self->{MethodName}
: "An un-named " . $self;
}
}
Although I've not been doing this long enough to decide if this is the best way to skin this particular cat
I'll put in an update method and see how that goes - I guess I just need more practice and direction to get it right. I'm not finding OOP too easy at the moment, need to read a few more books on it me thinks.
Thanks for the feedback!