A
Ala Qumsieh
I have a class that relies on other classes (as suggested in many
docs) that are to be used *exclusively* for this, i.e. not as
standalone classes.
Now I want to put all these classes in the same (separate) module so
that only the "main" one is made (explicitly) available to the final
user, and my question is wether there's any convention/direction for
assigning a name to the "other" classes:
I guess different people would do it differently. I would make is such that
each module is in a separate file, and would name them such that each '::'
in the module name corresponds to a real directory hierarchy. You don't have
to do that of course, but I find it easier to look for files, and understand
what class uses what. Something like this (untested):
$SOME_PATH/cool/module/foo.pm:
package cool::module::foo;
sub new { ... }
$SOME_PATH/cool/module.pm:
package cool::module;
use lib $SOME_PATH;
use cool::module::foo;
sub new { ... }
That will make it easier if you want to use cool::module::foo in some other
class as well.
--Ala