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
Write an example explaining the use of symbol tables.
How to read multi lines from a file in perl?
How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?
Explain socket programming in perl?
What does 'do' statement do in perl?
What are numeric operators in perl?
What is the purpose of _package_ literal?
Explain perl. When do you use perl for programming?
What is confess function in perl?
Explain ivalue?
How to read a single line from a file in perl?
Explain the different types of data perl can handle.
How are parameters passed to subroutines in perl?
what are the three groups involved in information sharing?
What is perl push array function?