Why we use "use lib $path"?

Answer Posted / guest

If we are trying to add a module or library files in our
program using require or use statement then it will search
that module or library files in the Perl's default search path.

The statement use lib is used to add the directories to
default search path.

So if the module or library file is not located in the
Perl's default search path then it will find the library
files in the path we have given with the use lib $path.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

779


How to open and read data files with Perl

812


What is epoch time in perl?

679


What are the arguements we normally use for perl interpreter?

715


What rules must be followed by modules in perl.

735


Why is it hard to call this function: sub y { "because" } ?

707


What does read () command do?

673


How will you declare a variable in perl?

728


How to open a directory in perl?

788


Write an example explaining the use of symbol tables.

718


What does `$result = f() .. g()' really return?

762


how to get back up from private character editor which is saved in the format of .udf

2057


Show the use of sockets for the server and client side of a conversation?

654


Why Perl aliases are considered to be faster than references?

725


What syntax is used for grep() function?

771