What is the difference between module and package?

Answer Posted / kiruthikau

- 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:

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

541


What are prefix dereferencer? List them.

562


Elaborate on perl bite-wise operators.

520


What is the purpose of _package_ literal?

533


What is the importance of perl warnings? How do you turn them on?

542






Explain the use of 'my' keyword in perl?

559


What is boolean context?

546


Write an example explaining the use of symbol tables.

560


What is “grep” function in perl?

560


What are the advantages and disadvantages of perl language?

476


What are some common methods to all handles in perl?

500


How can you define “my” variables scope in Perl and how it is different from “local” variable scope?

624


what is the main function of fork() in cgi programming?

545


What is the difference between use and require in perl programming?

511


Differentiate between arrays and list in perl.

534