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?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
What is 'rollback' command in perl?
In CPAN module, name an instance you use.
what is the function of Return Value?
How many ways can we express string in Perl?
How many types of operators are used in the Perl?
Comment on data types and variables in perl.
Which feature of perl provides code reusability?
Comment on the scope of variables in perl.
how to extract pin_code,phone_number,year from text file using regular expressions in perl
How to concatenate strings in perl?
Explain the default scope of variables in perl?
How to read from a pipeline with Perl