Explain the difference between use and require?
Answer Posted / gopi sreekanth
use can take a bareword and require doesnot while accessing
module
use is used in compile time ie all code is parsed before
program run where as require is used in run time. So if
there is much code in initialization include that in use
rather than require
use supports import method by default and require doesnt
support
Inside use default import method will be present. BEGIN {
require Module; }
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a chomp() function in perl?
What is the use of -t?
In Perl, what is grep function used for?
What is automatic error handling in perl?
Differentiate use and require?
How many types of primary data structures in Perl and what do they mean?
Is perl a case sensitive language?
How to read a directory in perl?
Explain grooving and shortening of arrays?
Explain strftime() function in perl?
what is Perl one liner?
How will you create a file in perl?
How would you ensure the re-use and maximum readability of your perl code?
There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"
What are the advantages and disadvantages of perl language?