Author image Gisle Aas


mylib - add private lib to the module search path


  #!/usr/bin/perl -w

  use strict;
  use mylib;

  use Private::Module;


This is just a convenient wrapper around FindBin and lib that will prepend to perl's search path the lib directory either found in the directory of the script or its parent directory. If neither of these locations contain a lib directory it will die.

This makes it easy to create a collection of scripts that share private modules (not to be installed with perl) using the traditional Unix layout of sibling bin, lib, man, etc,... directories.

The following variables can be imported:


This is the directory where the lib directory is found.


This is the same as "$Prefix/lib".


This is the same as "$Prefix/etc".


This will normally either be $Prefix or "$Prefix/bin". It is the same as $FindBin::RealBin.


Copyright 2008 Gisle Aas.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


rlib, FindBin, lib