http://www.perlmonks.org?node_id=1082794


in reply to What are the advantages or disadvantages of "require" over "use"

What tobyink said. An example where I always choose require and put it in subs/methods is the admin functions in webapps. Most of an application’s users can’t even see the admin code so there is no point in taking the hit on all requests. Plus you can be less worried about bringing in many/heavy/slow modules–

use AllUserStuff; sub admin_stuff { require HugeExpensiveCodeRarelyEverCalled; require ManyMoreOtheSame; ... }

Just make sure to write good tests around it so you don’t get the run time surprises you mentioned.