#!/usr/bin/perl
### the file doing the requiring
use strict;
use warnings;
use lib '/path/to/lib';
require('tmp.pl');
asdf();
####
#!/usr/bin/perl
### the file being required
use strict;
use warnings;
print "hi there\n";
sub asdf { print "well howdy"; }
1;
####
### the output
hi there
well howdy