Perl Monk, Perl Meditation | |
PerlMonks |
Package Proliferationby throop (Chaplain) |
on Jun 19, 2011 at 15:39 UTC ( [id://910441]=perlquestion: print w/replies, xml ) | Need Help?? |
throop has asked for the wisdom of the Perl Monks concerning the following question:
Why have a separate package for every file in a project?
A current project's goal is to take two sets of requirements (old and new). Find the best matches between them. Major subtasks are:
All the tutorials and examples (e.g. perltoot) show a different package for each file (something like RqMatch::InSanity, RqMatch::Weight, RqMatch::Matches, RqMatch::Report). And the modules that I've downloaded from CPAN mostly follow this scheme. Why? Why not just put them all in a single package? The project isn't large enough for naming collisions to be a problem. Suppose I use the same package throughout. During development, when I notice that a file has grown large enough to become unwieldy, and has developed two separate themes, I just create a new file and move some of the functions / methods over there. I don't have to do any package-management to my existing files. But if I give the new file its own package, then I have to doublecheck all the places I've invoked those functions. What does it buy me?
Back to
Seekers of Perl Wisdom
|
|