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