Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: difference between packages and module

by vinoth.ree (Monsignor)
on Mar 12, 2009 at 05:10 UTC ( [id://750080]=note: print w/replies, xml ) Need Help??


in reply to difference between packages and module

* Packages are perl files with .pm extn and is considered a separate namespace. So a package is nothing but group of related scalars,arrays,hashes and subroutines for a specific purpose.

Once a package is included in a .pl file (using "use") and you want to call one of the subroutines of the package, you may have to use the scope resolution operator &package::subroutine1

* Modules are packages but which has the capabilities of exporting selective subroutines/scalars/arrays/hashes of the package to the namespace of the main package itself. So for the interpreter these look as though the subroutines are part of the main package itself and so there is no need to use the scope resolution operator while calling them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://750080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-03-29 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found