Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Where and when you should place 'use module;'?

by haoess (Curate)
on Oct 12, 2005 at 12:52 UTC ( #499463=note: print w/replies, xml ) Need Help??


in reply to Where and when you should place 'use module;'?

If your modules where only used sometimes, i. e. not every sub is called always when your program runs, you could require them:

sub only_uses_sometimes { require My::Module; # and call import, if you want some exported things }

Now the module will be loaded at run time.

--Frank

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://499463]
help
Chatterbox?
erix foresees fungibility problems ;)
erix goes afk - catch y'all later
[Corion]: LanX: Broken links in what sense?
[Discipulus]: neurocent goes always up with the same curve of population raise
[marto]: believe in derp coin
[Corion]: Oh - I see ...
[LanX]: like http://cb60. datenzoo.de/:// perlmonks.org/ index.pl?node_id= 1215217
[Discipulus]: username links i bet
[Corion]: (also, let me recommend https://mini-cb60. datenzoo.de/ over that, as it has https :)
[LanX]: all links

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2018-05-25 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?