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

What are perl strings?

504


For a situation in programming, how can you determine that Perl is a suitable?

482


Where do we require ‘chomp’ and what does it mean?

512


How to start perl in interactive mode?

559


Explain different types of perl operators.

536






What does -> symbol indicates in Perl?

559


How does polymorphism work in perl?

514


What are the various advantages and disadvantages of perl?

460


Differentiate use and require?

519


What are scalars?

543


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

524


How to open and read data files with Perl

603


How to read a directory in perl?

530


What is the difference between die and exit in perl?

563


What are the various file operations in perl. Explain with example.

516