mwhuen
asked on
use or require?
what is the difference of use and require?
use lib? push?
Can any one explain?
Thanks.
use lib? push?
Can any one explain?
Thanks.
* use Module
Imports some semantics into the current package from the
named module, generally by aliasing certain subroutine
or variable names into your package. It is exactly
equivalent to
BEGIN { require Module; import Module LIST; }
* require file
Demands that a library file be included if it hasn't already been included.
* use lib
This is a small simple module which simplifies the manipulation of @INC at compile time.
It is typically used to add extra directories to perl's search path so that later `use' or `require' statements will find modules which are not located on perl's default search path.
* push ARRAY,LIST
Treats ARRAY as a stack, and pushes the values of LIST onto the end of ARRAY. The length of ARRAY increases by the length of LIST. Has the same effect as
for $value (LIST) {
$ARRAY[++$#ARRAY] = $value;
}
but is more efficient. Returns the new number of elements in the array.
Imports some semantics into the current package from the
named module, generally by aliasing certain subroutine
or variable names into your package. It is exactly
equivalent to
BEGIN { require Module; import Module LIST; }
* require file
Demands that a library file be included if it hasn't already been included.
* use lib
This is a small simple module which simplifies the manipulation of @INC at compile time.
It is typically used to add extra directories to perl's search path so that later `use' or `require' statements will find modules which are not located on perl's default search path.
* push ARRAY,LIST
Treats ARRAY as a stack, and pushes the values of LIST onto the end of ARRAY. The length of ARRAY increases by the length of LIST. Has the same effect as
for $value (LIST) {
$ARRAY[++$#ARRAY] = $value;
}
but is more efficient. Returns the new number of elements in the array.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
perldoc -f require
perldoc lib
perldoc -f push