in reply to Packaging up my code sensibly
For your first point, you should read this thread on code reuse and method sharing, there are several ideas that are discussed for sharing objects through utility classes and superclasses.
For your second point, why not just have a MyPackage::Config file? Just something simple like this should work:
On the one had it may seem like overkill to make a module just for just reading config files, but I've done that before and I've found that abstracting out the reading/writing of configuration files makes your program read well. It also separates your configuration file format out, so that if you ever decide to change from a require'd file, then you only have to change that in one place. I personally think that requiring or eval'ing code in that manner is a bad idea, but that's a separate discussion.use MyPackage::Config; my $cgi_url = MyPackage::Config->cgi_url;
Even better, once you make that configuration file object, you can share it using whatever method you use to share HTML::Template objects from your first question. :)
I actually think your third question may be answered in the linked thread as well. That thread is actually more pertinent to this question than the first.