in reply to OO Design question.
Also, you set a severity in $self, but isn't the severity already implied by the type of object returned from parse_body?
I'd probably make it like:
sub analysis { .... returns one of 'critical', 'harmless', 'unseen'; } sub parse_body { my $self = shift; $self->set_severity(analysis($self->mailbody))->severity; } sub set_severity { $_[0]{severity} = $_[1]; # Substitute your favourite OO implemen +tation $_[0]; } sub severity { $_[0]{severity}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OO Design question.
by Anonymous Monk on Sep 29, 2011 at 14:12 UTC |