Explain the difference between use and require?
Answer Posted / gopi sreekanth
use can take a bareword and require doesnot while accessing
module
use is used in compile time ie all code is parsed before
program run where as require is used in run time. So if
there is much code in initialization include that in use
rather than require
use supports import method by default and require doesnt
support
Inside use default import method will be present. BEGIN {
require Module; }
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the use of -n and -p options?
How will you get the count of parameters passed to a perl subroutine?
What is the difference between exec and system?
What does the’$_’ symbol mean?
Explain which feature of PERL provides code reusability?
List the operator used in Perl?
Explain chop?
What's the difference between /^Foo/s and /^Foo/?
Explain the use of 'my' keyword in perl?
Explain subroutine?
What does the q{ } operator do?
Can you add two arrays together?
What is the use of –w?
What is the use of "stderr()"?
What is perl programming?