in reply to Package/module organisation question

The approach that is taken by, e.g., RPC::Any might be useful to the overall organization of an application like this one; ditto UNIVERSAL::require.   It is often useful that the various components of a large application should be “demand loaded” into memory only when needed, and these packages illustrate working implementations of this ... and, in the case of RPC::Any, also present you with a simple way to distinguish between what is externally callable (by a web request, say), and what is not.   I have used these two modules personally with great success.

The use directive is used to incorporate any packages that may be needed “all the time” by any package.   Anything that a demand-loaded package uses, if not in memory already, will thereby be incorporated (once...).   If already present, nothing else happens.

In my experience, most such applications naturally divide themselves (besides the core...) into several concerns, such as “request handlers,” “objects,” and “common utilities.”   Of these three, request handlers are what is usually dynamically loaded.   Everything else simply takes care of itself.   I usually deploy with FastCGI (Plack), and arrange for the request handlers to “commit hara-kiri” (this actually is the term that Plack uses...) after a few thousand requests have been served, so that memory is periodically cleaned-up by the operating system.   I highly recommend that you take a very close look at Plack.