package A; use lib '.'; use B; sub new { return bless {}, shift; } sub call_b { my ($self) = @_; my $b = B->new; return $b->call_rest_client; } 1;