Which functions in Perl allows you to include a module file or a module and what is the difference between them?

Answer

“use”

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

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

3. We don’t need to specify the file extension.

4. loads the module at compile time.

“require”

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

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

3. We need to specify the file Extension.

4. Loads at run-time.

suppose we have a module file as “Module.pm”

use Module;

or

require “Module.pm”;

(will do the same)

All perl Questions

Ask your interview questions on perl

Write Your comment or Questions if you want the answers on perl from perl Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---