Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello

Let me know What is the difference between Package and Modules and its future.

Replies are listed 'Best First'.
Re: Difference between Package and Module
by friedo (Prior) on Apr 12, 2005 at 07:06 UTC
    A package is a namespace beginning with a package declaration and continuing until the end of the file or enclosing block. A module is a file with Perl code in it whose name ends in .pm. A module may contain zero or more packages. The default package is main. Everything goes in main unless otherwise specified.

    For more, see package, and perlmod.

Re: Difference between Package and Module
by davido (Cardinal) on Apr 12, 2005 at 07:04 UTC

    A package is a namespace. A module is a collection of related code grouped together with a namespace of the same name as the file in which it and the related code resides. This is a loose definition. More detail can and should be found in perlmod. I encourage you to read it. It should clear up a lot of confusion (and probably will create other areas of confusion. ;)


    Dave