Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
What do can I do to keep the inherited naming structure and autoload the tie routines? Can I put multiple package statements/sections in my one ABC.pm file? Yes, though it can get a little messy. For example, you could call this module
with the script
Note that you cannot use Foo::Bar since the file does not exist. The Foo use statement loads Foo::Bar into the namespace. (-- Not quite true: see below) 52 of them make autoloading seem worthwhile. Although if they are in separate packages, each one containing only the tie routines for one "tie-to" name, maybe autoloading isn't worthwhile? You can use a base class (i.e. ISA) to define your autoload routines, so no matter how many files you have, the actual code is localized. A good intro (if you need it) on constructing a base class for exactly this is found in perltoot. Update: As a template for the autoload code, I give you a modified module
and script
Now if you'll excuse me, I have some documentation to read -- ikegami just blew my mind. In reply to Re: Autoloading tie routines
by kennethk
|
|