in reply to cleaning up code with "do" ?

Why do you think require won't work? The only catch is the "1;" needed at the end of the required file.

--- File: a.pl --- use DBI; use MIME::Base64; BEGIN { require 'b.pl'; } $VARA = 'a'; local $\ = "\n"; testb(); # Never imported. sub testa { print("and we're back"); print($VARB); # Never imported. print(catfile('1', '0')); # Never imported in this file. } --- File: b.pl --- use File::Spec::Functions; $VARB = 'b'; sub testb { print("magical newlines"); # $\ taking effect. print($DBI::VERSION); # Never used DBI in this file. print(encode_base64("Hello World")); # Never imported in this file. print($VARA); # Never imported. testa(); # Never imported. } 1; --- output --- magical newlines 1.28 SGVsbG8gV29ybGQ= a and we're back b 1/0