Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: To module or not?

by splinky (Hermit)
on Apr 26, 2005 at 14:14 UTC ( #451579=note: print w/replies, xml ) Need Help??


in reply to Re: To module or not?
in thread To module or not?

Just to comment a little further...

The whole purpose of a module is to give you your own namespace, so you don't have to compete with the main program or other modules for subroutine names. So that's why you put "package MyModule;" at the top... to get your own namespace.

The Exporter stuff allows users of your module to selectively import your subs into their namespace, so they don't have to type "MyModule::addit" if they don't want to.

Replies are listed 'Best First'.
Re^3: To module or not?
by suaveant (Parson) on Apr 26, 2005 at 14:42 UTC
    I wouldn't say that is the whole purpose of a module... the purpose of package is to give you a namespace, the purpose of modules is reusable code :)

                    - Ant
                    - Some of my best work - (1 2 3)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://451579]
help
Chatterbox?
[marto]: damn
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)
[marto]: in 3 years I may be able to go :P
[Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though
[Corion]: marto: Hehe ;)
[marto]: my out of working hours time is very scarce at the moment
[marto]: unfortunately for you guys I can still access PM during the day :P
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-06-29 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.