What is the difference between module and package?
Answer Posted / shankarreddy k
A module is basically a set of subroutines that are
designed to do a specific set of tasks, all with a common
goal/topic. You "use" modules in your Perl code and once
you do, their functions are available to you.
Now, say you have two modules that end up having two
functions with the same name, but do two completely
different things. You need to be able to tell them apart.
That is where the module, acts like a namespace.
For example, if modules "My::First::Module"
and "My::Second::Module" both have a function called "Count
()", but you need the version from "My::First::Module",
then you would specify that when you called the function,
like so:
My::First::Module::Count(options)
{
some code;
}
Ok, that is my take on this topic. Short and sweet.
Hopefully, if there is more, and I am sure there is, that
someone will enlighten not only you, but me as well.
Regards,
shankar
Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Explain join function in perl?
What are the logical operators used for small scale operations?
Mention the difference between die and exit in Perl?
how to create a flat file database as shown below s.no name age city phone 0 hema 22 Calcutta 4312542 1 hema 21 Bangalore 2344345 2 ganesh 25 delhi 2445454 3 kartik 45 pune 4312121 4 santosh 25 Hyderabad 2254231 5 kumar 25 mysore 2344567 6 gita 34 mangalore 6532123 7 gita 32 pune 2213456 Q1.print the details of the person who r from bangalore q2.Replace the city name managlore to pune q3.prints no of person having name gita and hema q4.print how many are of age 25.
How can you call a subroutine and identify a subroutine?
What are the various perl data types based on the context?
What is perl scripting?
What does -> symbol indicates in Perl?
What are the various file operations in perl. Explain with example.
Why aren't Perl's patterns regular expressions?
Explain 'grep' function.
What is the use of strict?
In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?
what are the steps involved in reading a cgi script on the server?
What is perl unshift array function?