The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Unix::MyPathToInc - Add the location of the current program to @INC.


  use Unix::MyPathToInc;

  use Unix::MyPathToInc qw(/ lib);


Add the location of the current program to @INC, or perhaps several subdirectories related to the location of $0. If used with no imports, adds the current directory to @INC, or dies. Imports can be used to name directories relative to the program location (use an import of "/" to name the directory containing $0 when using explicit imports).


Requires that the script be executable.

Using $0 to modify @INC is criminally insane from a security standpoint. Don't use this module unless you understand its consequences.