in reply to What is module? Difference between module and package?
A module is a .pm file containing some Perl code. A package is a declaration of the name of the current scope, e.g.:
package Math::Complex
which can occur in the code of a module or a script. A module can be used, because it is a physical 'thing', but a package cannot. A module may contain several packages: CPAN does this. The advantage is that the code inside that module can still be chunked up into classes/etc. by package declarations, as if these classes were separate modules, but that the functionality is still lumped into a single convenient file.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What is module? Difference between module and package?
by liz (Monsignor) on Oct 28, 2005 at 11:54 UTC |
In Section
Seekers of Perl Wisdom