in reply to Perl Modules Scope ?
Like the others, I suggest that you take a double-step back from your present design, and look for something better. In particular, for something that already exists in CPAN that is better.
The CPAN website contains everything from full-fledged application frameworks (e.g. Dancer) to lower-level tools (e.g. CGI::Application) that have both been used to implement a helluva lot of production code that, every day, earns a helluva lot of money. :-) Take a good, long look at the SYNOPSIS section of both of these ... especially the latter. You will observe a number of things.
First, that there are rarely “many separate .cgi files.” This is not PHP. Even if the URIs are formed that way to facilitate the needs of browsers and their Back button, there is often just one single program that uses the URI-string as part of its input.
Second, that the target-script in question is almost a stub ... it instantiates an object and then tells that object to “run.” The operative routines are either used, or they are loaded on-demand via require (or [mod://UNIVERSAL::require). This strategy provides consistency and avoids duplication of code.
Finally, Perl web applications do not “mix source-code with HTML,” as PHP does or did. They are almost always driven by templates (e.g. Template::Toolkit). They consist of highly modular programs which take a URI-string as input, select some module to do processing, and use templates to prepare HTML (or JSON or what-have-you) output. And the foundations have already been laid. If you describe your project more, you’ll get lots of good suggestions as to what foundation might work best for your project.