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 perl unshift array function?
How will you declare a variable in perl?
How do I send e-mail from a Perl/CGI program on a Unix system?
What is eval function in perl?
Explain tk?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
How to read a directory in perl?
Explain perl. When do you use perl for programming? What are the advantages of programming in perl?
How to create a package?
Explain grooving and shortening of arrays?
What does cgi program store?
Why aren't Perl's patterns regular expressions?
In CPAN module, name an instance you use.
Does Perl have objects? If yes, then does it force you to use objects? If no, then why?
How does a “grep” function perform?