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
Who created perl?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
Explain perl. What are the advantages of programming in perl?
How to remove a directory in perl?
How do I debug a perl program?
Explain 'grep' function.
What is the use of '>>' in perl?
What is cpan in perl?
You want to empty an array. How would you do that?
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
What is qq (double q)operator in perl?
Explain the execution of a program in perl.
What does a die() function do in perl?
What are prefix dereferencer? List them.