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 do I replace every TAB character in a file with a comma?
What is the importance of perl warnings?
What does undef function in perl?
You want to empty an array. How would you do that?
How to connect to SQL server through Perl?
How do you give functions private variables that retain their values between calls?
What is confess 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?
How to read multi lines from a file in perl?
What are the different string manipulation operators in perl?
Mention the difference between die and exit in Perl?
What are the advantages of perl programming?
How do I read command-line arguments with Perl?
How do find the length of an array?
Explain subroutine?