what is the difference between require and use in perl?
Answer Posted / vinoth_bksys
The differences are many and often subtle:
* use only expects a bareword, require can take a
bareword or an expression
* use is evaluated at compile-time, require at run-time
* use implicitly calls the import method of the module
being loaded, require does not
* use excepts arguments in addition to the bareword (to
be passed to import), require does not
* use does not behave like a function (i.e can't be
called with parens, can't be used in an expression, etc),
whereas require does
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How will you access an element of a perl array?
What is perl dbi?
In Perl, what is grep function used for?
You want to read command-line arguements with perl. How would you do that?
Explain substr function in perl?
You want to empty an array. How would you do that?
What is the use of command “use strict”?
How many types of operators are used in the Perl?
Write syntax to use grep function?
Explain perl. When do you use perl for programming? What are the advantages of programming in perl?
How to start perl in interactive mode?
Explain gmtime() function in perl?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
What is the use of -n and -p options?
Difference between the variables in which chomp function work ?