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

How we can navigate the xml documents?

539


What are perl strings?

516


What are the various advantages and disadvantages of perl?

471


Write a program to decode the data in the form using cgi programming

550


Explain strftime() function in perl?

543






explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

465


What are some common methods to all handles in perl?

510


Why aren't Perl's patterns regular expressions?

595


How many loop control keywords are there in perl?

559


Why should I use the -w argument with my Perl programs?

563


What is the use of "stderr()"?

573


Explain what is perl language?

517


How can information be put into hashes?

540


What does `$result = f() .. g()' really return?

573


When would `local $_' in a function ruin your day?

546