# The actual method to be called: sub calculate_foo { my $self = shift; $self->_calculate_foo(); return $self->foo; } # A private method that actually updates $self->foo sub _calculate_foo { my $self = shift; $self->foo($self->foo + 999); return $self }