require is a call to an external program/condition, that has to be met before the scrcipt/program can continue.
loginprompt
Jun 20th, 2006
load code from file at run-time
Vimaladevi
Jul 13th, 2006
require is a call to load in external funtions from a library at run time.
karthik
Aug 22nd, 2006
require loads the code at run time. if the require file is not listed in the directory it produces an fatal error.
Swanand
Mar 27th, 2007
'require' is like a preprocessor directive in C/C++ which imports the external file . You can use the subroutines inside the current source code which are defined in the external file.
require function is used to load a seperate perl script or module in run time.If the file to be loaded is not in the directories listed in @INC array then full path of the perl file is to be passed in the require function .
ex . require "require.pl"; require "Mymodule.pm"; The location of perl file require.pl should be in directories listed in @INC.
otherwise give fullpath - require"/home/user/require.pl";
Once the perl file is loaded , %INC variable is updated with latest loaded perl file as key and its location as value .That's why before loading perl file ,require function checks if the file is already there in %INC.If file is there then it'll not load the file.
What's is the use of 'require' and what does this mean?