in reply to How do I bury some code ?

I'm not sure I understand your question either, but it sounds like you want to put multiple packages into a single .pm file. You can do this with
package A; # some code here package B; # more code here package C; # and still more code
Save that as Foo.pm and then use Foo; will load packages A, B, and C (and not package Foo, since it's not defined). Packages normally have the same name as the .pm file that contain them and have a one-to-one relationship, but that's by convention (and a very good convention!), not because the language requires it. You can put many packages into a single file or split a single package across many files. But remember that just because you can doesn't necessarily mean you should.

Given the description of what you want to accomplish, you may want to take a look at how the DBI and DBD modules are structured and call each other, since they have a similar design where you just use DBI, then it loads up whichever DBD module(s) it needs behind the scenes without needlessly combining them into a single source file.

Replies are listed 'Best First'.
Re^2: How do I bury some code ?
by rbi (Monk) on Aug 31, 2007 at 16:22 UTC
    Thanks but I want files to be separated into a directory structure. Following your idea, I'd be happy if I could have one file for the package that can include a list of files, and each of these again include other files. The result after inclusion (at compile time) would be the file you suggest.
    Something like Filter::Macro does, but for files with just a set of instructions to be included, not modules.