package MyApp { use Moo; has cgi => (is => 'ro'); has database => (is => 'ro'); has session => (is => 'ro'); sub do_something { my $self = shift; $self->databsse->foo(...); $self->cgi->bar(...); my $foo = $self->another_subroutine($somevar, $othervar); return $self->final_result($foo); } sub another_subroutine { my $self = shift; my ($somevar, $othervar) = @_; return $self->database->baz($self->cgi, $somevar, $othervar); } sub final_result { my $self = shift; my ($foo) = @_; my $result = $self->cgi + $self->session + $foo; return $result; } }