As of 5.37.7 when an@INC
hook is executed the index of the@INC
array that holds the hook will be localized into the$INC
variable. When the hook returns the integer successor of its value will be used to determine the next index in@INC
that will be checked, thus if it is set to -1 (orundef
) the traversal over the@INC
array will be restarted from its beginning.
Normally traversal through the@INC
array is from beginning to end (0 .. $#INC
), and if the@INC
array is modified by the hook the iterator may be left in a state where newly added entries are skipped. Changing this value allows an@INC
hook to rewrite the@INC
array and tell Perl where to continue afterwards. See"require" in perlfunc for details on@INC
hooks.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.