in reply to building modules

At the bare, bare minimum, call it .pm & put 1; at the end. Then you can put this in your scripts:
use lib "/path_to_my_module/"; use my_module;
this will give you access to all the subs.