sub foo { my ($self, $data) = @_; $self->{bar} = _some_function($data); }