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:
$Prefix
This is the directory where the lib directory is found.
$Lib
This is the same as "$Prefix/lib".
"$Prefix/lib"
$Etc
This is the same as "$Prefix/etc".
"$Prefix/etc"
$Bin
This will normally either be $Prefix or "$Prefix/bin". It is the same as $FindBin::RealBin.
"$Prefix/bin"
$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
To install mylib, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mylib
CPAN shell
perl -MCPAN -e shell install mylib
For more information on module installation, please visit the detailed CPAN module installation guide.