#!/usr/bin/perl use strict; use warnings; BEGIN { push(@INC, $ENV{'HOME'} . '/lib'); } use Foo::A; use Foo::Bar::B; my $a = Foo::A->new(); my $b = Foo::Bar::B->new();