Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can we create perl programs in unix, windows nt, macintosh and os/2 ?

892


Explain the use of 'my' keyword in perl?

1022


What are the logical operators used for small scale operations? Explain them briefly.

988


What are scalars in perl?

964


What does next statement do in perl?

998


what is Chop & Chomp function does?

997


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

989


How to sort arrays in perl?

1030


What is warn function in perl?

959


Explain the different types of data perl can handle.

898


What is an interpolation in perl?

996


How will you create a file in perl?

992


What is the different between array and hash in perl programming?

931


Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.

1051


Which functions in Perl allows you to include a module file or a module and what is the difference between them?

1013