Note that require "$lib/Module.pm" would also have worked if $lib contains an absolute directory (and probably even if it doesn't?)
You could also make the change to @INC temporary using local @INC = ( $lib, @INC );.
In reply to Re^3: dynamically expand @INC beyond BEGIN
by ikegami
in thread dynamically expand @INC beyond BEGIN
by somekindafreak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |