In some perl programs, I see they begin with
BEGIN
{
push(@INC, '/home/usr1/Modules');
}
I would like to know what does this part intend to do?
In some perl programs, I see they begin with
BEGIN
{
push(@INC, '/home/usr1/Modules');
}
I would like to know what does this part intend to do?
This ensures that any perl modules which are contained in the directory /home/usr1/Modules
will be available for usage.
When one types use ModuleName
, Perl will search every directory in @INC
for the file ModuleName.pm
.