Qualcomm Interview Question Software Engineer in Tests
0of 0 votesuse vs require keyword. How to create module
Use and Require are most common methods used to load modules.
Use:
1) It is evaluated at compile time only.
2) it is used only to load modules.
3)No need to give file extensions when we are using "use"
Require:
1)This is evaluated at Run time
2)This method is used for both libraries and modules.
3)Need to give file extensions like pl,pm etc..

use is evaluated at compile time. Require is evaluated at run time. So Require is good if you want one module or another but the instantiation overhead of both is very large which means you want to instantiate only the one you need.
- Mafioso on January 03, 2012 Edit | Flag Reply