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 to convert strings into an array in perl?
Explain the meaning of subroutine?
What is the importance of perl warnings?
Which has the highest precedence, List or Terms? Explain?
Explain lexical variables.
What does `$result = f() .. g()' really return?
Why we use CGI?
What is subroutine in perl?
What is the difference between perl array and perl hash?
List the data types that Perl can handle?
Explain the use of 'my' keyword in perl?
Why is it hard to call this function: sub y { "because" } ?
What are the options that can be used to avoid logic errors in perl?
How do I generate a list of all .html files in a directory?
What does undef function in perl?