How To Dynamically Add a Path to the Perl @INC At Compile-Time

Author: , April 16th, 2021

The key is to define a variable first, then use the BEGIN block to initialize the variable, then reference the variable in use lib $var; later on ;-} For example, enable a module contained in the same directory as a script called via the PATH: