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 name?
What do you mean by context of a subroutine?
Why we use CGI?
How can you use Perl warnings and what is the importance to use them?
What does init 5 and init 0 do?
How many loop control keywords are there in perl?
What is eval function in perl?
How do you match one letter in the current locale?
What are the various file operations in perl. Explain with example.
Explain lists ?
What are the logical operators used for small scale operations?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
How will you access an element of a perl array?
Explain goto label, goto name, and goto expr?
What is cpan ? What are the modules coming under this?