#!/usr/bin/perl use warnings; use strict; use lib '/tmp/'; package Foo; use Bar; sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = {}; return $self; } sub get_bar { return Bar->new(); } 1;