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 'rollback' command in perl?
Where do we require ‘chomp’ and what does it mean?
How to close a file in perl?
Write syntax to add two arrays together in perl?
Which functions in perl allows you to include a module file. State their differences.
what is Polymorphism in Perl?
How would you ensure the re-use and maximum readability of your perl code?
What does cgi program store?
Write a program to decode the data in the form using cgi programming
How can you define “my” variables scope in Perl and how it is different from “local” variable scope?
What does the qq{ } operator do?
How to determine strings length in perl?
What is perl programming?
What are the options that can be used to avoid logic errors in perl?
Write a program that explains the symbolic table clearly.