package y; use Exporter qw (import ); our @EXPORT = qw ( &foo ); # exported functions my $callpack = ( caller )[0]; eval <<"EOH"; package $callpack; use Data::Dumper; use B::Deparse; # other modules... EOH sub foo { ... } 1; #### #!/usr/bin/Perl use strict; use warnings; use y; #### qwurx [shmem] ~> perl -My -nle 'dwim $_' somefile