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 open a file in a write-only mode in perl?
What is the difference between perl array and perl hash?
Why should I use the -w argument with my Perl programs?
what are the two ways to get private values inside a subroutine or block?
What are some of the key features of objects in perl?
Explain a tell function in perl?
What is the use of strict?
How to remove a directory in perl?
What is warn function in perl?
Explain socket programming in perl?
What are the features of perl language?
How can memory be managed in Perl?
Explain the meaning of perl one-liner?
Explain the internal working of cgi
Where do we require ‘chomp’ and what does it mean?