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
How to start perl in interactive mode?
What are the different instances used in cgi overhead?
you are required to replace a char in a string and store the number of replacements. How would you do that?
How do I sort a hash by the hash key?
what is the difference between java and cgi?
How to remove a directory in perl?
What is a perl references?
Explain what is the scalar data and scalar variables in Perl?
Why aren't Perl's patterns regular expressions?
How would you ensure the re-use and maximum readability of your perl code?
You want to download the contents of a url with perl. How would you do that?
Explain the meaning of subroutine?
Explain the meaning of closure in perl.
How many loop control keywords are there in perl?
What are the various advantages and disadvantages of perl?