Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: when is a perl module executed?

by blazar (Canon)
on Jul 18, 2008 at 22:40 UTC ( #698752=note: print w/replies, xml ) Need Help??


in reply to Re^3: when is a perl module executed?
in thread when is a perl module executed?

I personally believe that you're confused (and incidentally the way you like to write tends to confirm that you are:) people clearly told you that you can have code out of subs in modules. That is, it's valid Perl. People generally use modules as collections of reusable code: subs to be imported as additions to the builtins or methods of some class. There's no reason they shouldn't also do things. Indeed, they often have to, to "initialize" in some way or another those collections of code. For example, think of a module which will connect to some site to retrieve some info and build suitable "constants" - it's not that strange...

--
If you can't understand the incipit, then please check the IPB Campaign.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://698752]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2018-06-21 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?