What is the difference between module and package?
Answer Posted / rameshravi
A package is a division of the global namespace; that means
you can have a global variable $foo and/or a sub named foo
in one package and a different global variable $foo and
different sub named foo in a different package.
A "module" is a file named according to the package it
contains, so module Foo::Bar would be in a file named
Foo/Bar.pm. There's no need for packages to be modules or
for a module to contain only that one package.
The term "module distribution" refers to a collection of one
or more modules that get built/installed together. Sometimes
the "distribution" part is left off and it's just called
"module", but it's really a different idea than a single module.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What does init 5 and init 0 do?
what is the function that is used to identify how many characters are there in a string?
What does delete function do in perl?
What are the options that can be used to avoid logic errors in perl?
what are the strategies followed for multiple form interaction in cgi programs?
Explain the various characteristics of perl.
what are the two ways to get private values inside a subroutine or block?
What happens when you return a reference to a private variable?
What are prefix dereferencer?
What is the purpose of _package_ literal?
Create a function that is only available inside the scope where it is defined ?
Explain perl. When do you use perl for programming?
How can information be put into hashes?
Why Perl aliases are considered to be faster than references?
Write a program that explains the symbolic table clearly.