Explain the difference between use and require?

Answer Posted / kush

Use :

1. The method is used only for the modules(only to include
.pm type file)

2. The included objects are varified at the time of compilation.

3. No Need to give file extension.

Require:

1. The method is used for both libraries and modules.

2. The included objects are varified at the run time.

3. Need to give file Extension.

Is This Answer Correct ?    38 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a die() function do in perl?

545


What is use of ‘->’ symbol?

540


What are the logical operators used for small scale operations?

551


How do I do fill_in_the_blank for each file in a directory?

548


Explain grooving and shortening of arrays and splicing of arrays?

506






Does Perl have objects? If yes, then does it force you to use objects? If no, then why?

550


Explain perl. What are the advantages of programming in perl?

570


What are the different ways to run cgi?

495


Explain goto expr?

499


How can the user execute a long command repeatedly without typing it again and again?

510


What are the two ways to get private values inside a subroutine?

456


What are scalars?

555


Differentiate between use and require, my and local, for and foreach and exec and system

489


Explain lists and ivalue?

561


Explain subroutine in perl?

492