package Foo; use strict; use warnings our $VERSION = '1.00'; use base 'Exporter'; our @EXPORT = qw( foo ); sub foo { return "bar\n"; } 1; # later, in your main program you say: use strict; use warnings use lib q(/path/to/Foo); use Foo; print foo();