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
Explain goto expr?
What is 'rollback' command in perl?
What are the logical operators used for small scale operations? Explain them briefly.
How and what are closures implemented in perl?
How interpreter is used in perl?
Explain the meaning of closure in perl.
Which guidelines by Perl modules must be followed?
What is automatic error handling in perl?
Which of these is a difference between Perl and C++ ?
Can we load binary extension dynamically?
What is “grep” function in perl?
What are the steps involved when the cgi program starts running?
How do find the length of an array?
How to access parameters passed to a subroutine in perl?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?