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
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
Explain goto label?
Elaborate on perl bite-wise operators.
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
Explain the default scope of variables in perl?
What is v-strings?
How to sort arrays in perl?
Why do we use "use strict" in perl?
Which of these is a difference between Perl and C++ ?
Why is it hard to call this function: sub y { "because" } ?
How to dereference a reference?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
How to read file into hash array ?
You want to connect to sql server through perl. How would you do that?
What are the advantages and disadvantages of perl language?