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
Can inheritance be used in perl? Explain with the help of an example.
How many ways can we express string in Perl?
What can be done for efficient parameter passing in perl? Explain.
How to read a single line from a file in perl?
How can you call a subroutine and identify a subroutine?
How will you get the count of parameters passed to a perl subroutine?
Which guidelines by Perl modules must be followed?
what are prefix dereferencer and list them out?
What are arrays in perl?
Explain different types of perl operators.
Differentiate use and require?
What is the use of -t?
What is the difference between perl array and perl hash?
Write a program that shows the distinction between child and parent process?
When does circular reference occur?