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
Comment on data types and variables in perl.
How and what are closures implemented in perl?
Write syntax to add two arrays together in perl?
What does the qx{ } operator do?
What are the various file operations in perl. Explain with example.
What is the syntax used in Perl grep function?
List the prefix dereferencer in Perl.
How to remove a directory in perl?
What is perl? What is the basic command to print a string in perl?
How do I sort a hash by the hash key?
Which functions in perl allows you to include a module file.
How to read a single line from a file in perl?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
What is the difference between use and require in perl?
Why is it hard to call this function: sub y { "because" } ?