Explain the difference between use and require?

Answer Posted / vinoth.g

The use statement works at compile time, require at run
time. So if you have a module that does a lot in a begin
block and you don't really need it in all cases, then it's
clever to "require" it there where you want to use it but
don't "use" it. So you don't have to wait for all that
initializations of that module in case you don't need it.

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can arrays be tied?

504


What happens in dereferencing?

511


How to turn on Perl warnings? Why is that important?

553


Explain splicing of arrays?

495


When would `local $_' in a function ruin your day?

520






Explain chop?

518


Write a cgi program to show the header part?

501


Why to use perl?

520


how to connect cisco switch uisng perl script

3361


What are the functions that can be performed using cgi program?

466


What is automatic error handling in perl?

484


How to replace perl array elements?

513


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

507


what are the strategies followed for multiple form interaction in cgi programs?

490


Explain substr function in perl?

517