Explain the difference between use and require?
Answer Posted / vinoth.g
The use statement works at compile time, require at run
time. So if you have a module that does a lot in a begin
block and you don't really need it in all cases, then it's
clever to "require" it there where you want to use it but
don't "use" it. So you don't have to wait for all that
initializations of that module in case you don't need it.
Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
what are the three groups involved in information sharing?
What are the various flags/arguments that can be used while executing a perl program?
How will you get the count of parameters passed to a perl subroutine?
How to close a directory in perl?
What does file test operators do in perl?
How to know whether a key exists or not in perl?
Explain goto label, goto name, and goto expr?
How to check the status of airplane mode (enable/disable) in perl for Android mobile?
What can be done for efficient parameter passing in perl?
Write a script to reverse a string without using perl's built in functions?
what is Perl one liner?
What are perl strings?
Difference between the variables in which chomp function work ?
What are the different string manipulation operators in perl?
What is lexical variable in perl?