I have two perl scripts. Both have no "package" keyword or anything. One has a sub (and plus some free floating code too) that I want to use in another script, without running the free floating code in the process.
A.pl
sub my_sub {
# do something
}
# do something else
my_sub();
# do something else
B.pl
require A.pl; # but load only the subs, don't run anything
my_sub();
Is this possible without having to separate out the sub in a separate .pm file and then loading it?